Object of class WP_Error could not be converted to string

get_term can return a WP_Error object in addition to a falsy value for term not found or an actual term row. You fix this, by adding an additional check: if (!$term) { continue; } Becomes: if (!$term || is_wp_error($term)) { continue; } You should also do this above the get_term_link call. $term = get_term($value, $fieldSettings[‘taxonomy’]); … Read more

WordPress Errors in generated by theme check plugin [closed]

File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls. The WordPress coding styles require that you make use of the WP Filesystem instead of using direct PHP file functions. You can replace your file_get_contents call easily with: $response = wp_remote_get($feed_url); $file_content = $response[‘body’]; For more specific infos just take a look … Read more

Remove Menu Page Giving Error

Put the add_action line inside the if (!current_user_can(‘activate_plugins’) ) {: <?php /************ Remove admin menu items from anyone who isn’t an admin ************/ if (!current_user_can(‘activate_plugins’) ) { function my_remove_menu_pages() { remove_menu_page(‘link-manager.php’); remove_menu_page(‘tools.php’); remove_menu_page(‘edit-comments.php’); } add_action( ‘admin_menu’, ‘my_remove_menu_pages’ ); }; ?>

500 Internal Server Error after Register dialog, but with successful registration

Internal Server errors are usually thrown when there’s an error somewhere in the code. You did the right thing searching the logs, but depending on your hosting configuration not all errors can be written there. I like using WordPress’s own logging facility. Here’s what you need to do: Stick the following lines in your wp-config.php … Read more