Skip to content

Instantly share code, notes, and snippets.

@jkudish
Created November 4, 2011 04:53
Show Gist options
  • Save jkudish/1338686 to your computer and use it in GitHub Desktop.
Save jkudish/1338686 to your computer and use it in GitHub Desktop.
THIS FILE EXPLAINS HOW TO USE THE sld_register_post_type() function
<?php
// THIS FILE EXPLAINS HOW TO USE THE sld_register_post_type() FUNCTION FROM THE FOLLOWING WP PLUGIN: https://github.com/jkudish/sld-custom-content-and-taxonomies
/**
* sld_register_post_type()
* @param $post_type_slug the slug of the type to register
* @param $optional_args can be passed all of the same arguments as register_post_type()
* @see http://codex.wordpress.org/Function_Reference/register_post_type
* @param $optional_custom_plural, the plural name for this post type
* @author Joachim Kudish <[email protected]>
*/
sld_register_post_type( $post_type_slug, $optional_args, $optional_custom_plural );
/* =============================
NOTES:
By default the $type will be converted to have a Capital letter and used as the label,
an S will be added to it to make the plural label, unless overwritten by $optional_custom_plural
The following defaults will be set unless you overwride them in $optional_args:
'show_ui' => true,
'public' => true,
'supports' => array('title', 'editor', 'thumbnail'),
'publicly_queryable' => true,
'query_var' => true,
'exclude_from_search' => false,
'capability_type' => 'post',
'has_archive' => true,
'rewrite' => array('slug' => $post_type_slug, 'with_front' => false),
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment