Core error when calling remove_menu_page

The error line comes from the following in wp-admin/includes/plugin.php: function remove_menu_page( $menu_slug ) { global $menu; foreach ( $menu as $i => $item ) { if ( $menu_slug === $item[2] ) { unset( $menu[ $i ] ); return $item; } } return false; } The global $menu does not actually get populated until the wp-admin/menu-header.php … Read more

Trying to add taxonomy terms to search results page

I’m having some trouble understanding your code. It looks like you’re: Looping over every search result. For each result, getting all tempo terms. For each tempo, querying all posts that belong to that term. Doing nothing with the queried posts. This is all extremely inefficient and doesn’t do anything like what you say you’re trying … Read more

Warning when author has no post

Try wrapping the rsort bit in an if statement like this: if (!empty($post_dates)) { rsort($post_dates); } else { echo ‘optional error message here’; } This will check to see if the variable is empty first, and only run rsort() if it is not empty. This check works most of the time, but a false positive … Read more

Attempt to read property “ID” on null”

Understanding: global $post The WordPress global variable $post, contains the data of the current post within the The Loop. WordPress will assign a value to this variable in each loop iteration. If you’re trying to access $post from outside the WP loop, it will be null or “”. You should be able to use the … Read more