Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Add Drawings custom post type
- add_action( 'init', 'generate_paintings_init' );
- /**
- * Register custom post type.
- *
- * @link http://codex.wordpress.org/Function_Reference/register_post_type
- */
- function generate_paintings_init() {
- $labels = array(
- 'name' => _x( 'paintings', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'Painting', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'Paintings', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'Paintings', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'painting', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New Painting', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New Painting', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit Painting', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View Painting', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All Paintings', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search Paintings', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent Paintings:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No paintings found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No paintings found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'description' => __( 'Description.', 'your-plugin-textdomain' ),
- 'public' => true,
- 'rewrite' => array( 'slug' => 'paintings' ),
- 'capability_type' => 'post',
- 'has_archive' => false,
- 'menu_icon' => 'dashicons-admin-customizer',
- 'supports' => array( 'title', 'thumbnail', 'custom-fields')
- );
- register_post_type( 'Paintings', $args );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement