Advertisement
Guest User

Untitled

a guest
Mar 8th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.88 KB | None | 0 0
  1. //Add Drawings custom post type
  2. add_action( 'init', 'generate_paintings_init' );
  3. /**
  4.  * Register custom post type.
  5.  *
  6.  * @link http://codex.wordpress.org/Function_Reference/register_post_type
  7.  */
  8. function generate_paintings_init() {
  9.     $labels = array(
  10.         'name'               => _x( 'paintings', 'post type general name', 'your-plugin-textdomain' ),
  11.         'singular_name'      => _x( 'Painting', 'post type singular name', 'your-plugin-textdomain' ),
  12.         'menu_name'          => _x( 'Paintings', 'admin menu', 'your-plugin-textdomain' ),
  13.         'name_admin_bar'     => _x( 'Paintings', 'add new on admin bar', 'your-plugin-textdomain' ),
  14.         'add_new'            => _x( 'Add New', 'painting', 'your-plugin-textdomain' ),
  15.         'add_new_item'       => __( 'Add New Painting', 'your-plugin-textdomain' ),
  16.         'new_item'           => __( 'New Painting', 'your-plugin-textdomain' ),
  17.         'edit_item'          => __( 'Edit Painting', 'your-plugin-textdomain' ),
  18.         'view_item'          => __( 'View Painting', 'your-plugin-textdomain' ),
  19.         'all_items'          => __( 'All Paintings', 'your-plugin-textdomain' ),
  20.         'search_items'       => __( 'Search Paintings', 'your-plugin-textdomain' ),
  21.         'parent_item_colon'  => __( 'Parent Paintings:', 'your-plugin-textdomain' ),
  22.         'not_found'          => __( 'No paintings found.', 'your-plugin-textdomain' ),
  23.         'not_found_in_trash' => __( 'No paintings found in Trash.', 'your-plugin-textdomain' )
  24.     );
  25.  
  26.     $args = array(
  27.         'labels'             => $labels,
  28.                 'description'        => __( 'Description.', 'your-plugin-textdomain' ),
  29.         'public'             => true,
  30.         'rewrite'            => array( 'slug' => 'paintings' ),
  31.         'capability_type'    => 'post',
  32.         'has_archive'        => false,
  33.         'menu_icon'   => 'dashicons-admin-customizer',
  34.         'supports'           => array( 'title', 'thumbnail', 'custom-fields')
  35.     );
  36.  
  37.     register_post_type( 'Paintings', $args );
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement