Created
August 27, 2013 16:30
-
-
Save mustardBees/6355845 to your computer and use it in GitHub Desktop.
Register a store post type in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create store post type | |
* | |
* @author Phil Wylie | |
* @link http://goo.gl/bjc6XV | |
*/ | |
function pw_register_store_post_type() { | |
$labels = array( | |
'name' => 'Stores', | |
'singular_name' => 'Store', | |
'add_new' => 'Add New', | |
'add_new_item' => 'Add New Store', | |
'edit_item' => 'Edit Store', | |
'new_item' => 'New Store', | |
'view_item' => 'View Store', | |
'search_items' => 'Search Stores', | |
'not_found' => 'No stores found', | |
'not_found_in_trash' => 'No stores found in Trash', | |
'parent_item_colon' => 'Parent Store:', | |
'menu_name' => 'Stores' | |
); | |
$args = array( | |
'labels' => $labels, | |
'hierarchical' => false, | |
'supports' => array( 'title' ), | |
'public' => false, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => false, | |
'publicly_queryable' => false, | |
'exclude_from_search' => true, | |
'has_archive' => false, | |
'query_var' => false, | |
'can_export' => true, | |
'rewrite' => false, | |
'capability_type' => 'post' | |
); | |
register_post_type( 'store', $args ); | |
} | |
add_action( 'init', 'pw_register_store_post_type' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment