Skip to content

Instantly share code, notes, and snippets.

@weskoop
Forked from robertdall/hides-columns.php
Last active December 11, 2015 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save weskoop/4649526 to your computer and use it in GitHub Desktop.
Save weskoop/4649526 to your computer and use it in GitHub Desktop.
// Hides Yoast SEO Plugin Field Columns for Author users and below
// @since Jan, 2013
// @author R. Dall
function my_columns_filter( $columns ) {
if( ! current_user_can( 'edit_users' ) )
unset( $columns['wpseo-score'], $columns['wpseo-title'], $columns['wpseo-metadesc'], $columns['wpseo-focuskw'] );
return $columns;
}
// Filter pages, post, CPT
add_filter( 'manage_edit-page_columns', 'my_columns_filter',10, 1 );
add_filter( 'manage_edit-post_columns', 'my_columns_filter',10, 1 );
add_filter( 'manage_edit-surgeon_columns', 'my_columns_filter',10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment