简体   繁体   中英

Remove Wordpress Plugin functionality from admin side

I'm using a WordPress plugin https://github.com/lesterchan/wp-postratings . It also showing ratings on admin, when i visit http://domain.com/wp-admin/edit.php . 在此处输入图片说明 How do i remove those ratings from admin side.

You can use the below function in your functions.php file with the manage_posts_columns filter. I'm assuming your custom post type id 'tools' and the column is referenced by 'ratings'. If they are different you can just change that in the code.

add_filter( 'manage_posts_columns', 'custom_post_columns', 10, 2 );
function custom_post_columns( $columns, $post_type ) {

  switch ( $post_type ) {    

    //assuming the id for the custom post type is 'tools'
    case 'tools':
    unset(
      //I'm using 'ratings' but you'll have to check and see what the name for the column really is.
      $columns['ratings']
    );
    break;

  }

  return $columns;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM