kpirnie

KB CPT

May 25th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1.         $labels = array( 'name' => 'Knowledge Base Articles',
  2.                          'singular_name' => 'Article',
  3.                          'menu_name' => 'Knowledge Base',
  4.                          'add_new_item' => 'Add an Article', );
  5.         $args = array( 'label' => 'Knowledge Base Articles',
  6.             'labels' => $labels,
  7.             'supports' => array( 'title', 'editor', 'page-attributes', ),
  8.             'taxonomies' => array( 'kb_categories', 'kb_tags' ),
  9.             'hierarchical' => true,
  10.             'public' => true,
  11.             'show_ui' => true,
  12.             'show_in_menu' => true,
  13.             'menu_position' => 21,
  14.             'menu_icon'  => 'dashicons-screenoptions',
  15.             'show_in_admin_bar' => false,
  16.             'show_in_nav_menus' => true,
  17.             'can_export' => true,
  18.             'has_archive' => true,
  19.             'exclude_from_search' => ( ! $_kbopt_search ),
  20.             'publicly_queryable' => true,
  21.             'query_var' => 'gyo_kb',
  22.             'show_in_rest' => true,
  23.             'rewrite' => array( 'slug' => $_kbopt_rewrite ),
  24.             );
  25.         register_post_type( 'gyo_kb', $args );
  26.         flush_rewrite_rules( );
Advertisement
Add Comment
Please, Sign In to add comment