Advertisement
phpface

Untitled

Jan 19th, 2022
1,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. /**
  2.  *
  3.  * Change default video slug to clip
  4.  *
  5.  * @param  array $args
  6.  * @param  string $post_type
  7.  * @return array
  8.  */
  9. function streamtube_child_change_video_post_type_slug( $args, $post_type ) {
  10.  
  11.     // change the video slug, for example: clip
  12.     $new_slug = 'clip';
  13.  
  14.     if ( 'video' === $post_type ) {
  15.         $args['rewrite']['slug'] = $new_slug;
  16.     }
  17.  
  18.     return $args;
  19. }
  20. add_filter( 'register_post_type_args', 'streamtube_child_change_video_post_type_slug', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement