Created
October 6, 2011 20:46
-
-
Save zanematthew/1268620 to your computer and use it in GitHub Desktop.
Sample: registerPostType
This file contains hidden or 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
public function registerPostType( $args=NULL ) { | |
foreach ( $this->post_type as $post_type ) { | |
if ( !empty( $post_type['taxonomies'] ) ) | |
$taxonomies = $post_type['taxonomies']; | |
. | |
. | |
. | |
. | |
$labels = array( | |
'name' => _x( $post_type['name'], 'post type general name'), | |
'singular_name' => _x( $post_type['singular_name'], 'post type singular name'), | |
'add_new' => _x('Add New ' . $post_type['singular_name'] . '', 'something'), | |
'add_new_item' => __('Add New ' . $post_type['singular_name'] . ''), | |
'edit_item' => __('Edit '. $post_type['singular_name'] .''), | |
'new_item' => __('New '. $post_type['singular_name'] .''), | |
'view_item' => __('View '. $post_type['singular_name'] . ''), | |
'search_items' => __('Search ' . $post_type['singular_name'] . ''), | |
'not_found' => __('No ' . $post_type['singular_name'] . ' found'), | |
'not_found_in_trash' => __('No ' . $post_type['singular_name'] . ' found in Trash'), | |
'parent_item_colon' => '' | |
); | |
. | |
. | |
. | |
register_post_type( $post_type['type'], $args); | |
} // End 'foreach' | |
return $this->post_type; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment