Advertisement
michaellevelup

CPT Rest API

Feb 1st, 2022
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. function custom_create_posttype() {
  2.  
  3.     register_post_type( 'codecinfo',
  4.        
  5.         array(
  6.             'labels' => array(
  7.                 'name' => __( 'CodecInfo' ),
  8.                 'singular_name' => __( 'CodecInfo' )
  9.             ),
  10.             'public' => true,
  11.             'has_archive' => true,
  12.             'rewrite' => array('slug' => 'codecinfo'),
  13.             'show_in_rest' => true,
  14.  
  15.         )
  16.     );
  17. }
  18.  
  19. add_action( 'init', 'custom_create_posttype' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement