Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Remove the Categories widget if current logged in user isn't editor or admin
- */
- add_filter( 'streamtube/core/post/edit/taxes_not_included', function( $taxes_not_included, $post_id ){
- if( ! current_user_can( 'delete_others_pages' ) ){
- $taxes_not_included[] = 'categories';
- }
- return $taxes_not_included;
- }, 10, 2 );
- /**
- * Change the Tags label to Categories
- */
- add_filter( 'streamtube_core_the_field_control_args', function( $args ){
- if( current_user_can( 'delete_others_pages' ) ){
- return $args;
- }
- if( array_key_exists( 'name', $args ) && $args['name'] == 'tax_input[video_tag]' ){
- $args['label'] = esc_html__( 'Categories', 'streamtube-core' );
- }
- return $args;
- }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement