Guest User

Untitled

a guest
Apr 26th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. // Register Custom Post Type spouse post name is slider
  2. function slider() {
  3. $labels = array(
  4. 'name' => _x( 'Post Types', 'Post Type General Name', 'Post Types' ),
  5. 'singular_name' => _x( 'Post Type', 'Post Type Singular Name', 'Post Types' ),
  6. 'menu_name' => __( 'Post Types', 'Post Types' ),
  7. 'name_admin_bar' => __( 'Post Type', 'Post Types' ),
  8. 'archives' => __( 'Item Archives', 'Post Types' ),
  9. 'parent_item_colon' => __( 'Parent Item:', 'Post Types' ),
  10. 'all_items' => __( 'All Items', 'Post Types' ),
  11. 'add_new_item' => __( 'Add New Item', 'Post Types' ),
  12. 'add_new' => __( 'Add New', 'Post Types' ),
  13. 'new_item' => __( 'New Item', 'Post Types' ),
  14. 'edit_item' => __( 'Edit Item', 'Post Types' ),
  15. 'update_item' => __( 'Update Item', 'Post Types' ),
  16. 'view_item' => __( 'View Item', 'Post Types' ),
  17. 'search_items' => __( 'Search Item', 'Post Types' ),
  18. 'not_found' => __( 'Not found', 'Post Types' ),
  19. 'not_found_in_trash' => __( 'Not found in Trash', 'Post Types' ),
  20. 'featured_image' => __( 'Featured Image', 'Post Types' ),
  21. 'set_featured_image' => __( 'Set featured image', 'Post Types' ),
  22. 'remove_featured_image' => __( 'Remove featured image', 'Post Types' ),
  23. 'use_featured_image' => __( 'Use as featured image', 'Post Types' ),
  24. 'insert_into_item' => __( 'Insert into item', 'Post Types' ),
  25. 'uploaded_to_this_item' => __( 'Uploaded to this item', 'Post Types' ),
  26. 'items_list' => __( 'Items list', 'Post Types' ),
  27. 'items_list_navigation' => __( 'Items list navigation', 'Post Types' ),
  28. 'filter_items_list' => __( 'Filter items list', 'Post Types' ),
  29. );
  30. $args = array(
  31. 'label' => __( 'Post Type', 'Post Types' ),
  32. 'description' => __( 'Post Type Description', 'Post Types' ),
  33. 'labels' => $labels,
  34. 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
  35. 'taxonomies' => array( 'category', 'post_tag' ),
  36. 'hierarchical' => false,
  37. 'public' => true,
  38. 'show_ui' => true,
  39. 'show_in_menu' => true,
  40. 'menu_position' => 5,
  41. 'menu_icon' => 'dashicons-images-alt',
  42. 'show_in_admin_bar' => true,
  43. 'show_in_nav_menus' => true,
  44. 'can_export' => true,
  45. 'has_archive' => true,
  46. 'exclude_from_search' => false,
  47. 'publicly_queryable' => true,
  48. 'capability_type' => 'page',
  49. );
  50. register_post_type( 'slider', $args );
  51. }
  52. add_action( 'init', 'slider', 0 );
Add Comment
Please, Sign In to add comment