Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. function codex_book_init() {
  2. $labels = array(
  3. 'name' => _x( 'Books', 'post type general name', 'your-plugin-textdomain' ),
  4. 'singular_name' => _x( 'Book', 'post type singular name', 'your-plugin-textdomain' ),
  5. 'menu_name' => _x( 'Books', 'admin menu', 'your-plugin-textdomain' ),
  6. 'name_admin_bar' => _x( 'Book', 'add new on admin bar', 'your-plugin-textdomain' ),
  7. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  8. 'add_new_item' => __( 'Add New Book', 'your-plugin-textdomain' ),
  9. 'new_item' => __( 'New Book', 'your-plugin-textdomain' ),
  10. 'edit_item' => __( 'Edit Book', 'your-plugin-textdomain' ),
  11. 'view_item' => __( 'View Book', 'your-plugin-textdomain' ),
  12. 'all_items' => __( 'All Books', 'your-plugin-textdomain' ),
  13. 'search_items' => __( 'Search Books', 'your-plugin-textdomain' ),
  14. 'parent_item_colon' => __( 'Parent Books:', 'your-plugin-textdomain' ),
  15. 'not_found' => __( 'No books found.', 'your-plugin-textdomain' ),
  16. 'not_found_in_trash' => __( 'No books found in Trash.', 'your-plugin-textdomain' )
  17. );
  18.  
  19. $args = array(
  20. 'labels' => $labels,
  21. 'description' => __( 'Description.', 'your-plugin-textdomain' ),
  22. 'public' => true,
  23. 'publicly_queryable' => true,
  24. 'show_ui' => true,
  25. 'show_in_menu' => true,
  26. 'query_var' => true,
  27. 'rewrite' => array( 'slug' => 'book' ),
  28. 'capability_type' => 'post',
  29. 'has_archive' => true,
  30. 'hierarchical' => false,
  31. 'menu_position' => null,
  32. 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
  33. );
  34.  
  35. register_post_type( 'book', $args );
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement