Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Register Custom Post Type
- function dogs_post_type() {
- $labels = array(
- 'name' => _x( 'Dogs', 'Post Type General Name', 'adopt' ),
- 'singular_name' => _x( 'Dog', 'Post Type Singular Name', 'adopt' ),
- 'menu_name' => __( 'Dogs', 'adopt' ),
- 'parent_item_colon' => __( 'Main Dog:', 'adopt' ),
- 'all_items' => __( 'All Dogs', 'adopt' ),
- 'view_item' => __( 'View Dog', 'adopt' ),
- 'add_new_item' => __( 'Add New Dog', 'adopt' ),
- 'add_new' => __( 'New Dog', 'adopt' ),
- 'new_item' => _x( 'New Dog', 'adopt' ),
- 'edit_item' => __( 'Edit Dog', 'adopt' ),
- 'update_item' => __( 'Update Dog', 'adopt' ),
- 'search_items' => __( 'Search Dogs', 'adopt' ),
- 'not_found' => __( 'No Dogs found', 'adopt' ),
- 'not_found_in_trash' => __( 'No Dogs found in Trash', 'adopt' ),
- );
- $args = array(
- 'label' => __( 'dogs', 'adopt' ),
- 'description' => __( 'To display dogs', 'adopt' ),
- 'labels' => $labels,
- 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
- 'taxonomies' => array( 'breed','location', 'size-dogs', 'sexes-dogs' ),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_nav_menus' => true,
- 'show_in_admin_bar' => true,
- 'menu_position' => 10,
- 'menu_icon' => 'dashicons-admin-post',
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'post',
- 'query_var' => false,
- 'rewrite' => array("slug"=>"dogs"), //Permalinks format,
- 'register_meta_box_cb' => 'add_dogs_metaboxes'
- );
- register_post_type( 'dogs', $args );
- }
- // Hook into the 'init' action
- add_action( 'init', 'dogs_post_type', 0 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement