Advertisement
firoze

custom-posts.php

Dec 13th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.09 KB | None | 0 0
  1.  
  2. function create_posttype() {
  3.  
  4. // Twenty Twenty Slider
  5.   register_post_type( 'twenty_slider',
  6.     array(
  7.       'labels' => array(
  8.        
  9.         'name'               => __( 'Twenty Sliders', 'post type general name', 'your-plugin-textdomain' ),
  10.         'singular_name'      => __( 'Twenty Slider', 'post type singular name', 'your-plugin-textdomain' ),
  11.         'menu_name'          => __( 'Twenty Sliders', 'admin menu', 'your-plugin-textdomain' ),
  12.         'name_admin_bar'     => __( 'Twenty Slider', 'add new on admin bar', 'your-plugin-textdomain' ),
  13.         'add_new'            => __( 'Add New', 'Twenty Slider', 'your-plugin-textdomain' ),
  14.         'add_new_item'       => __( 'Add New Twenty Slider', 'your-plugin-textdomain' ),
  15.         'new_item'           => __( 'New Twenty Slider', 'your-plugin-textdomain' ),
  16.         'edit_item'          => __( 'Edit Twenty Slider', 'your-plugin-textdomain' ),
  17.         'view_item'          => __( 'View Twenty Slider', 'your-plugin-textdomain' ),
  18.         'all_items'          => __( 'All Twenty Sliders', 'your-plugin-textdomain' ),
  19.         'search_items'       => __( 'Search Twenty Sliders', 'your-plugin-textdomain' ),
  20.         'parent_item_colon'  => __( 'Parent Twenty Sliders:', 'your-plugin-textdomain' ),
  21.         'not_found'          => __( 'No Twenty Sliders found.', 'your-plugin-textdomain' ),
  22.         'not_found_in_trash' => __( 'No Twenty Sliders found in Trash.', 'your-plugin-textdomain' )
  23.       ),
  24.                      'public'=> true,
  25.                   'menu_icon'=> 'dashicons-format-gallery ',  /* For Dashicons Menu */
  26.         'publicly_queryable' => true,
  27.         'show_ui'            => true,
  28.         'show_in_menu'       => true,
  29.         'query_var'          => true,
  30.         'rewrite'            => array( 'slug' => 'Twenty Slider' ),
  31.         'capability_type'    => 'post',
  32.         'has_archive'        => true,
  33.         'hierarchical'       => false,
  34.         'menu_position'      => null,
  35.         'supports'           => array('title')
  36.         // all supports options  'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments','trackbacks','custom-fields','revisions','page-attributes','post-formats'
  37.     )
  38.   );
  39.   // add another custom post
  40. }
  41. add_action( 'init', 'create_posttype' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement