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:
- When to use Exceptions vs Error Objects vs just plain false/null
- How to check if image is already stored in a site’s post database? (network)
- PHP Catchable fatal error: Object of class WP_Error could not be converted to string
- Customize default settings on new sites on multisite
- Sorting list of sites from multisite network using wp_get_sites
- Integrating WordPress to my website, while keeping my own authentication system
- WordPress “Link has expired” error on updating posts
- Notice: Constant already defined in wp-config.php on (non-existent) line?
- error_log is not working as expected in functions.php file
- “Can’t use function return value in write context” error
- Error when requesting password reset email – wp authentication
- “Notice: Undefined variable: content” is showing [closed]
- Can WordPress email the admin about PHP errors, while hiding them from the site?
- White Screen of Death – wp-admin
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- WordPress 5 WP REST routes – No errors
- wordpress media library new uploads don’t write to database
- WordPress Script stops suddenly
- A non-numeric value encountered in /wp-includes/functions.php on line 68
- How to call plugin function per site in a multisite?
- WordPress returns “The link you followed has expired” error page whenever I add a new site, add a user etc
- Make a list of sites for each user in WPMU – switch_to_blog (display in SITE_ID: 1)
- Getting error when using wp_insert_post()
- Headers already sent in Pluggable.php / homepage and wp-login error
- “Undefined index” error when saving empty array with checkboxes
- Moving code from theme header to functions.php
- Count posts on multisite with blog id
- Warning: Illegal string offset on theme options page [closed]
- How do I display offsite database info on my wordpress site?
- PHP if statement works in template files, but not header
- Timthumb.php image gallery not working on Multisite WordPress
- Find Site ID From WP_Post
- List all blogs, but exclude the main site
- PHP-warning in post-template.php and no loading content on pages
- Parse error: syntax error, unexpected ‘}’ [closed]
- Array to string conversion error in PHP 7.2 when returning user role as class
- PHP E_WARNING being shown despite php.ini [closed]
- Known Issues in WordPress When Upgrading PHP to ver 7
- can’t get errors
- Cannot load media and I get “PHP Warning: Invalid argument supplied for foreach(“
- Is it legal to redefine wp_password_change_notification in a mu plugin?
- Fatal Error wp-settings.php on line 119
- Trying to display terms from custom taxonomy within function
- Too many errors on log
- Programmatically revert to backup .htaccess a possibility?
- Prevent post from being published and show error
- How to sort posts by active category in WordPress?
- wordprees multi-site in user panel add filter
- bp-custom.php is not working on a WordPress multisite environment. how to fix it?
- WordPress Multisite login_redirect to primary blog and specific page based on role
- How can I update WordPress plugins or WordPress itself in all server?
- Can’t log in to WordPress wp-admin after adding code to functions.php
- White screen after migrating site, but wp-admin works fine. Disabling all plugins, applying default theme and enabling debug mode does nothing
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- WordPress Bad Request Error 400
- Internal Server Errors – Moving working multi-site install to my localhost
- 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
- 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?
- Getting an empty space in up sell items
- This occurs when I open admin or front on localhost
- Changable favicon
- Remove node from multisites?
- Add .php to end of all WordPress Pages (multisite)
- How to send logs to plugin owner for a plugin?
- Adding users to another blog
- 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
- Functions are causing errors
- 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
- Custom PHP-coding in MU installs
- .htaccess on multisite and roots theme?
- 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
- Query Concatenation
- WP Debug enabled Undefined index error in a widget
- php 7.0 update to 7.1 and at least 7.2
- 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!
- WordPress White Screen Error
- WPMU – How to echo only one URL
- 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
- Getting invalid user ID error when creating a new user with wp_insert_user
- 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’ );