Advertisement
phpface

Untitled

Mar 23rd, 2022 (edited)
931
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. /**
  2.  * Remove the Categories widget if current logged in user isn't editor or admin
  3.  */
  4. add_filter( 'streamtube/core/post/edit/taxes_not_included', function( $taxes_not_included, $post_id ){
  5.     if( ! current_user_can( 'delete_others_pages' ) ){
  6.         $taxes_not_included[] = 'categories';
  7.     }
  8.     return $taxes_not_included;
  9. }, 10, 2 );
  10.  
  11. /**
  12.  * Change the Tags label to Categories
  13.  */
  14. add_filter( 'streamtube_core_the_field_control_args', function( $args ){
  15.     if( current_user_can( 'delete_others_pages' ) ){
  16.         return $args;
  17.     }
  18.     if( array_key_exists( 'name', $args ) && $args['name'] == 'tax_input[video_tag]' ){
  19.         $args['label'] = esc_html__( 'Categories', 'streamtube-core' );
  20.     }
  21.     return $args;
  22. }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement