Guest User

Untitled

a guest
Jun 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1. add_action( 'init', 'codex_custom_init' );
  2. function codex_custom_init() {
  3.   $labels = array(
  4.     'name' => _x('Books', 'post type general name'),
  5.     'singular_name' => _x('Book', 'post type singular name'),
  6.     'add_new' => _x('Add New', 'book'),
  7.     'add_new_item' => __('Add New Book'),
  8.     'edit_item' => __('Edit Book'),
  9.     'new_item' => __('New Book'),
  10.     'all_items' => __('All Books'),
  11.     'view_item' => __('View Book'),
  12.     'search_items' => __('Search Books'),
  13.     'not_found' =>  __('No books found'),
  14.     'not_found_in_trash' => __('No books found in Trash'),
  15.     'parent_item_colon' => '',
  16.     'menu_name' => 'Books'
  17.  
  18.   );
  19.   $args = array(
  20.     'labels' => $labels,
  21.     'public' => true,
  22.     'publicly_queryable' => true,
  23.     'show_ui' => true,
  24.     'show_in_menu' => true,
  25.     'query_var' => true,
  26.     'rewrite' => true,
  27.     'capability_type' => 'post',
  28.     'has_archive' => true,
  29.     'hierarchical' => false,
  30.     'menu_position' => null,
  31.     'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
  32.   );
  33.   register_post_type('book',$args);
  34. }
Add Comment
Please, Sign In to add comment