Clean up whitespace in status/PT/tax registration.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-04 06:13:28 +00:00
parent c843c7edf3
commit 86c5154557
2 changed files with 146 additions and 130 deletions

View File

@ -15,112 +15,125 @@
* Creates the initial post types when 'init' action is fired.
*/
function create_initial_post_types() {
register_post_type( 'post', array( 'label' => __('Posts'),
'singular_label' => __('Post'),
'public' => true,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions')
) );
register_post_type( 'post', array(
'label' => __( 'Posts' ),
'singular_label' => __( 'Post' ),
'public' => true,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),
) );
register_post_type( 'page', array( 'label' => __('Pages'),
'singular_label' => __('Page'),
'public' => true,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'page',
'hierarchical' => true,
'rewrite' => false,
'query_var' => false,
'supports' => array('title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions')
) );
register_post_type( 'page', array(
'label' => __( 'Pages' ),
'singular_label' => __( 'Page' ),
'public' => true,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'page',
'hierarchical' => true,
'rewrite' => false,
'query_var' => false,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
) );
register_post_type( 'attachment', array('label' => __('Media'),
'public' => true,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'media.php?attachment_id=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
) );
register_post_type( 'attachment', array(
'label' => __( 'Media' ),
'public' => true,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'media.php?attachment_id=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
) );
register_post_type( 'revision', array( 'label' => __('Revisions'),
'singular_label' => __('Revision'),
'public' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
) );
register_post_type( 'revision', array(
'label' => __( 'Revisions' ),
'singular_label' => __( 'Revision' ),
'public' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
) );
register_post_type( 'nav_menu_item', array( 'label' => __('Navigation Menu Items'),
'singular_label' => __('Navigation Menu Item'),
'public' => false,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
) );
register_post_type( 'nav_menu_item', array(
'label' => __( 'Navigation Menu Items' ),
'singular_label' => __( 'Navigation Menu Item' ),
'public' => false,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
) );
register_post_status( 'publish', array( 'label' => _x('Published', 'post'),
'public' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>')
) );
register_post_status( 'publish', array(
'label' => _x( 'Published', 'post' ),
'public' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop( 'Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>' ),
) );
register_post_status( 'future', array( 'label' => _x('Scheduled', 'post'),
'protected' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>')
) );
register_post_status( 'future', array(
'label' => _x( 'Scheduled', 'post' ),
'protected' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>' ),
) );
register_post_status( 'draft', array( 'label' => _x('Draft', 'post'),
'protected' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')
) );
register_post_status( 'draft', array(
'label' => _x( 'Draft', 'post' ),
'protected' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop( 'Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>' ),
) );
register_post_status( 'pending', array( 'label' => _x('Pending', 'post'),
'protected' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop('Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>')
) );
register_post_status( 'pending', array(
'label' => _x( 'Pending', 'post' ),
'protected' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>' ),
) );
register_post_status( 'private', array( 'label' => _x('Private', 'post'),
'private' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')
) );
register_post_status( 'private', array(
'label' => _x( 'Private', 'post' ),
'private' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop( 'Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>' ),
) );
register_post_status( 'trash', array( 'label' => _x('Trash', 'post'),
'internal' => true,
'show_in_admin_status_list' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>')
) );
register_post_status( 'trash', array(
'label' => _x( 'Trash', 'post' ),
'internal' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>' ),
'show_in_admin_status_list' => true,
) );
register_post_status( 'auto-draft', array( 'label' => 'auto-draft',
'internal' => true,
'_builtin' => true, /* internal use only. */
) );
register_post_status( 'auto-draft', array(
'label' => 'auto-draft',
'internal' => true,
'_builtin' => true, /* internal use only. */
) );
register_post_status( 'inherit', array( 'label' => 'inherit',
'internal' => true,
'exclude_from_search' => false,
'_builtin' => true, /* internal use only. */
) );
register_post_status( 'inherit', array(
'label' => 'inherit',
'internal' => true,
'_builtin' => true, /* internal use only. */
'exclude_from_search' => false,
) );
}
add_action( 'init', 'create_initial_post_types', 0 ); // highest priority

View File

@ -15,46 +15,49 @@
* Creates the initial taxonomies when 'init' action is fired.
*/
function create_initial_taxonomies() {
register_taxonomy( 'category', 'post', array( 'hierarchical' => true,
'update_count_callback' => '_update_post_term_count',
'label' => __('Categories'),
'singular_label' => __('Category'),
'query_var' => false,
'rewrite' => false,
'public' => true,
'show_ui' => true,
'_builtin' => true
) ) ;
register_taxonomy( 'category', 'post', array(
'hierarchical' => true,
'update_count_callback' => '_update_post_term_count',
'label' => __( 'Categories' ),
'singular_label' => __( 'Category' ),
'query_var' => false,
'rewrite' => false,
'public' => true,
'show_ui' => true,
'_builtin' => true,
) ) ;
register_taxonomy( 'post_tag', 'post', array(
'hierarchical' => false,
'update_count_callback' => '_update_post_term_count',
'label' => __('Post Tags'),
'singular_label' => __('Post Tag'),
'query_var' => false,
'rewrite' => false,
'public' => true,
'show_ui' => true,
'_builtin' => true
) ) ;
'hierarchical' => false,
'update_count_callback' => '_update_post_term_count',
'label' => __( 'Post Tags' ),
'singular_label' => __( 'Post Tag' ),
'query_var' => false,
'rewrite' => false,
'public' => true,
'show_ui' => true,
'_builtin' => true,
) );
register_taxonomy( 'nav_menu', 'nav_menu_item', array( 'hierarchical' => false,
'label' => __('Navigation Menus'),
'singular_label' => __('Navigation Menu'),
'query_var' => false,
'rewrite' => false,
'show_ui' => false,
'_builtin' => true,
) ) ;
register_taxonomy( 'nav_menu', 'nav_menu_item', array(
'hierarchical' => false,
'label' => __( 'Navigation Menus' ),
'singular_label' => __( 'Navigation Menu' ),
'query_var' => false,
'rewrite' => false,
'show_ui' => false,
'_builtin' => true,
) ) ;
register_taxonomy( 'link_category', 'link', array( 'hierarchical' => false,
'label' => __('Categories'),
'query_var' => false,
'rewrite' => false,
'public' => false,
'show_ui' => false,
'_builtin' => true,
) ) ;
register_taxonomy( 'link_category', 'link', array(
'hierarchical' => false,
'label' => __( 'Categories' ),
'query_var' => false,
'rewrite' => false,
'public' => false,
'show_ui' => false,
'_builtin' => true,
) ) ;
}
add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority