Skip to content

Instantly share code, notes, and snippets.

@rachelmccollin
Last active August 29, 2015 14:15
Show Gist options
  • Save rachelmccollin/b9b82a11309a08faaf05 to your computer and use it in GitHub Desktop.
Save rachelmccollin/b9b82a11309a08faaf05 to your computer and use it in GitHub Desktop.
WPMU DEV snippets
// set up labels
$labels = array(
'name' => 'Products',
'singular_name' => 'Product',
'add_new' => 'Add New Product',
'add_new_item' => 'Add New Product',
'edit_item' => 'Edit Product',
'new_item' => 'New Product',
'all_items' => 'All Products',
'view_item' => 'View Product',
'search_items' => 'Search Products',
'not_found' => 'No Products Found',
'not_found_in_trash' => 'No Products found in Trash',
'parent_item_colon' => '',
'menu_name' => 'Products',
);
//register post type
register_post_type( 'product', array(
'labels' => $labels,
'has_archive' => true,
'public' => true,
'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail','page-attributes' ),
'taxonomies' => array( 'post_tag', 'category' ),
'exclude_from_search' => false,
'capability_type' => 'post',
'rewrite' => array( 'slug' => 'products' ),
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment