Illegal change of $typenow variable
-
The code below changes the $typenow global variable. I am pretty sure this is illegal and it breaks the ‘Admin Columns’ plugin in my case.
Please fix.
/**
* Remove WP SEO admin columns from post list tables
* @param boolean $show_columns [description]
* @return [type] [description]
*/
public function remove_admin_columns ( $show_columns = true ) {
global $typenow;// Ensure that correct post type is set
if( ! isset( $typenow ) || ! $typenow ) {
$typenow = ‘post’;
}// Hide admin columns for selected post types
if( $this->hide_from_post_type( $typenow, ‘columns’ ) ) {
$show_columns = apply_filters( $this->_token . ‘_show_admin_columns’, false );
}return $show_columns;
} // End remove_admin_columns ()
- The topic ‘Illegal change of $typenow variable’ is closed to new replies.