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
- How does wordpress know which site to setup (on multisite)?
- WordPress “Link has expired” error on updating posts
- Fix 403 error on WordPress multisite network using subdomains
- 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]
- How to create Sub Sub domain Multi User blogs?
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- How to find error in my code when the error message is pointing to WP core file?
- How to change home or site url using action hooks or filter?
- 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?
- Error on wp_default_style After upgrade to php 7
- NGINX rewrite rules for multisite
- 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
- Warning: Illegal string offset on theme options page [closed]
- How do I display offsite database info on my wordpress site?
- customize wordpress database error page
- 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
- After adding my website to a new server, I keep getting a unexpected end of file error, but the file is identitcal to it’s original source
- 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]
- Is it legal to redefine wp_password_change_notification in a mu plugin?
- Authentication from sub-folder non-wp cookie WordPress
- Trying to display terms from custom taxonomy within function
- Help with accessing wp-admin page and resolving error messages
- Blog suddenly shows Archive instead of index page
- Programmatically revert to backup .htaccess a possibility?
- Prevent post from being published and show error
- 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
- 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
- WordPress Bad Request Error 400
- 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
- Annoying/confusing WordPress memory limit exhausted
- Site title not showing. Please help me
- Create form which redirects to site in 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
- Remove node from multisites?
- How to send logs to plugin owner for a plugin?
- 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
- 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
- WordPress MS wp-admin/includes/post.php error with shortcode generator
- Troubleshooting “loopback requests that take too long”
- Query Concatenation
- WP Debug enabled Undefined index error in a widget
- What does that mean: cannot use a scalar value as an array [closed]
- 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
- Please help! Parse error: syntax error, unexpected ‘
- PHP warning $post->ID is null
- Execute multiple PHP Snippets causes error?
- Use of undefined constant issue
- WordPress 6.1.1 shows deprecated errors with PHP 8.1 & 8.2
- Internal server error when enabling Multisite in WordPress
- “Unexpected response from server” error when trying to upload any .mp4 file over 100MB
- taxonomy pages returning “NULL” when running default WordPress function ‘get_queried_object()’
- Undefined constant ABSPATH
- PHP Warning: Undefined array key “HTTP_REFERER”
- Single wordpress multi website down need help factoring what it is
- Enabling pretty permalinks with Docker, Multisite WordPress and Caddy
- Running WP-Cron on Multisite networks the right way?
- Set custom post type to load custom block pattern by default
- There has been a critical error on this website – wordpress issue after upgrading PHP