$wpdb->prepare() warning in WordPress 3.5

Remove the call to $wpdb->prepare(): $result = $wpdb->get_var( “SELECT DISTINCT meta_value FROM $metatable WHERE meta_key LIKE ‘%matchme%’ AND meta_value IS NOT NULL AND meta_value <> ”” ); In this case, the $wpdb->prepare() function is not doing anything. There are no variables holding unknown values, therefore there is no need to sanitize them. If you did … Read more

Debug mode shows Strict Standards

Just don’t set WP_DEBUG to TRUE. The error level is set in wp_debug_mode(), which is called in wp-settings.php before any plugins are loaded. If you leave the default values WordPress will set it to: error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); But you … Read more

Error 404 Page Not Found When Updating a Post or Page

Updating Permalink changes update your permalinks settings and flush rewrite rules. In most cases this fixes the WordPress posts 404 error. BTW, you already tried this and I hpe your .htaccess should be writable. Have you checked it? If not then you can change .htaccess file permission temporary writable by changing the permissions to 666 … Read more

$wpdb->last_error doesn’t show the query on error

If you want the query, that’ll be $wpdb->last_query (note that you also do not need SAVEQUERIES, that’s only if you want a log of every query ($wpdb->queries) last_error is… well, the error! Update: Possible explanation for last_error being empty – this is the source of wpdb::query(): // If we’re writing to the database, make sure … Read more

PHP Catchable fatal error: Object of class WP_Error could not be converted to string

Line 58 as the error indicates is this line: $parent_term = get_term_by(‘ID’,$term_id, $taxonomy); $term_parents = $delimiter.”<a href=\””.get_term_link($parent_term->slug,$taxonomy).”\” title=\””. $parent_term->name .”\” >”. $parent_term->name .”</a>” .$child_terms; And our error is: Object of class WP_Error could not be converted to string Which means that one of those things being appended is not a “string”, but actually a WP_Error … Read more