prepare
has always required two arguments, it just didn’t throw an error when used incorrectly until 3.5.
Basically, the use of prepare
in this case is not doing anything. Since you’re not passing potentially unsafe data to the query, you can remove it entirely to get rid of the error and just pass your query directly to get_var
.
$olddomain = $this->db->get_var( "SELECT option_value FROM {$this->db->options} WHERE option_name="siteurl" LIMIT 1" );
See the entry in wpdb
Protect Queries Against SQL Injection Attacks for correct use of prepare.
Related Posts:
- Running WP Cron on multisite the right way
- Should I use spl_autoload_register() in my plugin?
- WP-CLI – Selecting PHP version
- error_log() output for print_r() appearing on page
- When to use Exceptions vs Error Objects vs just plain false/null
- Trying to get property ‘ID’ and ‘post_author’ of non-object error
- HELP: cannot log into wordpress. PHP error
- Why am I getting syntax error, unexpected ‘endwhile’ (T_ENDWHILE) on single.php
- The link you followed has expired. Please try again
- PHP error on local server install
- Merging Multiple WordPress Websites
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- Annoying/confusing WordPress memory limit exhausted
- Site title not showing. Please help me
- Create form which redirects to site in network?
- Redirect user role to a specific page on login in a multisite network?
- PHP Error in WordPress Theme
- WordPress database error only while loading page for 1st time
- Getting an empty space in up sell items
- Multiple WordPress sites with different theme and plugin sharing the same content
- This occurs when I open admin or front on localhost
- Changable favicon
- Is there a way to search for a missing endif?
- Remove node from multisites?
- style.min.css code issue
- PHP script to redirect traffic based on website accessed
- Add .php to end of all WordPress Pages (multisite)
- PHP is_embed error showing up
- How to send logs to plugin owner for a plugin?
- List all blogs apart from the current blog and main blog in WordPress Multisite
- Adding users to another blog
- WordPress 3.0 PHP Error – notice WordPress_product_Type was called incorrectly
- Transfer WordPress Login Session to an Extended Webpage on the Same Domain
- Resource 404 error on multisite subdirectory install
- global $post inside plugin query messes up every new post page in wp-admin
- Importing demo data in Multisite
- use system script advertising in wordpress multisite
- WP Admin Bar – Get current theme name as custom menu title
- Headers Already Sent
- Functions are causing errors
- Too few arguments for printf() [closed]
- WPMU schedule doesn’t execute actions
- syntax error unexpected ‘}’ at 364 line
- WP multisite network plugin fails to see classes loaded with spl autoload
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- Host does not allow remote connection, so how do I transfer data to my WordPress site?
- WordPress won’t display errors at all
- Trying to post information from a remote database to wordpress page
- Custom PHP-coding in MU installs
- .htaccess on multisite and roots theme?
- Force string into signup form
- WordPress MS wp-admin/includes/post.php error with shortcode generator
- Troubleshooting “loopback requests that take too long”
- Data inserted in database, but ajax calls error function
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Query Concatenation
- WP Debug enabled Undefined index error in a widget
- php 7.0 update to 7.1 and at least 7.2
- What does that mean: cannot use a scalar value as an array [closed]
- problem with php function error
- How to handle PHP parse errors?
- I need a button to appear when not loged in and another when logged in, I need help fixing code PLEASE!
- PHP warning Invalid argument supplied for foreach() on custom page template
- WordPress White Screen Error
- WPMU – How to echo only one URL
- Please help! Parse error: syntax error, unexpected ‘
- Not able to see the error [closed]
- Need help with Deprecated: Non-static error when update PHP 7.4 -> 8.1 with Dyad 2 theme
- kali php problem [closed]
- PHP warning: Undefined array key 2 in feed.php
- Losing Session ID and sessionStorage when navigating to other domains on Multisite
- PHP warning $post->ID is null
- Getting invalid user ID error when creating a new user with wp_insert_user
- Execute multiple PHP Snippets causes error?
- Use of undefined constant issue
- WordPress 6.1.1 shows deprecated errors with PHP 8.1 & 8.2
- add_rewrite_rule image from /images/site2/favicon.ico to /favico.ico
- I can’t log into my website , it says “Error: Cookies are blocked due to unexpected output”
- Internal server error when enabling Multisite in WordPress
- Error when loading Dashboard
- WordPress @include( ‘template-config.php’ );
- “Unexpected response from server” error when trying to upload any .mp4 file over 100MB
- How to create a build for quickly deploying a server with WP?
- taxonomy pages returning “NULL” when running default WordPress function ‘get_queried_object()’
- NGINX rewrite rules for WordPress Subdirectory Multisite to support deep URL
- Undefined constant ABSPATH
- PHP Warning: Undefined array key “HTTP_REFERER”
- Single wordpress multi website down need help factoring what it is
- PHP Warning: Undefined array key “VirtualHostSubMenu” in index.php
- Change WordPress Multisite Domain to subfolder
- Headers already sent error
- Enabling pretty permalinks with Docker, Multisite WordPress and Caddy
- Running WP-Cron on Multisite networks the right way?
- Warning: Undefined variable $post_id
- How to add query string at the end of sitemap Yoast SEO
- How to Customize the Admin Sidebar Menu in WordPress Multisite Network by changing the backend code of the wp-admin code files?
- Facing 503 error on PHP files after deleting hidden files from the root folder
- Custom theme on multisite has issues with standard loop output
- Set custom post type to load custom block pattern by default
- REST API request between domain and subdomain