Make WordPress Core

Changeset 14432


Ignore:
Timestamp:
05/04/2010 06:13:28 AM (16 years ago)
Author:
nacin
Message:

Clean up whitespace in status/PT/tax registration.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r14431 r14432  
    1616 */
    1717function create_initial_post_types() {
    18         register_post_type( 'post', array(      'label' => __('Posts'),
    19                                                                                 'singular_label' => __('Post'),
    20                                                                                 'public' => true,
    21                                                                                 'show_ui' => false,
    22                                                                                 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
    23                                                                                 '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
    24                                                                                 'capability_type' => 'post',
    25                                                                                 'hierarchical' => false,
    26                                                                                 'rewrite' => false,
    27                                                                                 'query_var' => false,
    28                                                                                 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions')
    29                                                                         ) );
    30 
    31         register_post_type( 'page', array(      'label' => __('Pages'),
    32                                                                                 'singular_label' => __('Page'),
    33                                                                                 'public' => true,
    34                                                                                 'show_ui' => false,
    35                                                                                 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
    36                                                                                 '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
    37                                                                                 'capability_type' => 'page',
    38                                                                                 'hierarchical' => true,
    39                                                                                 'rewrite' => false,
    40                                                                                 'query_var' => false,
    41                                                                                 'supports' => array('title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions')
    42                                                                         ) );
    43 
    44         register_post_type( 'attachment', array('label' => __('Media'),
    45                                                                                         'public' => true,
    46                                                                                         'show_ui' => false,
    47                                                                                         '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
    48                                                                                         '_edit_link' => 'media.php?attachment_id=%d', /* internal use only. don't use this when registering your own post type. */
    49                                                                                         'capability_type' => 'post',
    50                                                                                         'hierarchical' => false,
    51                                                                                         'rewrite' => false,
    52                                                                                         'query_var' => false,
    53                                                                                 ) );
    54 
    55         register_post_type( 'revision', array(  'label' => __('Revisions'),
    56                                                                                         'singular_label' => __('Revision'),
    57                                                                                         'public' => false,
    58                                                                                         '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
    59                                                                                         '_edit_link' => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */
    60                                                                                         'capability_type' => 'post',
    61                                                                                         'hierarchical' => false,
    62                                                                                         'rewrite' => false,
    63                                                                                         'query_var' => false,
    64                                                                                 ) );
    65 
    66         register_post_type( 'nav_menu_item', array(     'label' => __('Navigation Menu Items'),
    67                                                                                                 'singular_label' => __('Navigation Menu Item'),
    68                                                                                                 'public' => false,
    69                                                                                                 'show_ui' => false,
    70                                                                                                 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
    71                                                                                                 'capability_type' => 'post',
    72                                                                                                 'hierarchical' => false,
    73                                                                                                 'rewrite' => false,
    74                                                                                                 'query_var' => false,
    75                                                                                         ) );
    76 
    77         register_post_status( 'publish', array( 'label' => _x('Published', 'post'),
    78                                                                                         'public' => true,
    79                                                                                         '_builtin' => true, /* internal use only. */
    80                                                                                         'label_count' => _n_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>')
    81                                                                                 ) );
    82 
    83         register_post_status( 'future', array(  'label' => _x('Scheduled', 'post'),
    84                                                                                         'protected' => true,
    85                                                                                         '_builtin' => true, /* internal use only. */
    86                                                                                         'label_count' => _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>')
    87                                                                                 ) );
    88 
    89         register_post_status( 'draft', array(   'label' => _x('Draft', 'post'),
    90                                                                                         'protected' => true,
    91                                                                                         '_builtin' => true, /* internal use only. */
    92                                                                                         'label_count' => _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')
    93                                                                                 ) );
    94 
    95         register_post_status( 'pending', array( 'label' => _x('Pending', 'post'),
    96                                                                                         'protected' => true,
    97                                                                                         '_builtin' => true, /* internal use only. */
    98                                                                                         'label_count' => _n_noop('Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>')
    99                                                                                 ) );
    100 
    101         register_post_status( 'private', array( 'label' => _x('Private', 'post'),
    102                                                                                         'private' => true,
    103                                                                                         '_builtin' => true, /* internal use only. */
    104                                                                                         'label_count' => _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')
    105                                                                                 ) );
    106 
    107         register_post_status( 'trash', array(   'label' => _x('Trash', 'post'),
    108                                                                                         'internal' => true,
    109                                                                                         'show_in_admin_status_list' => true,
    110                                                                                         '_builtin' => true, /* internal use only. */
    111                                                                                         'label_count' => _n_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>')
    112                                                                                 ) );
    113 
    114         register_post_status( 'auto-draft', array(      'label' => 'auto-draft',
    115                                                                                         'internal' => true,
    116                                                                                         '_builtin' => true, /* internal use only. */
    117                                                                                 ) );
    118 
    119         register_post_status( 'inherit', array( 'label' => 'inherit',
    120                                                                                         'internal' => true,
    121                                                                                         'exclude_from_search' => false,
    122                                                                                         '_builtin' => true, /* internal use only. */
    123                                                                                 ) );
     18        register_post_type( 'post', array(
     19                'label' => __( 'Posts' ),
     20                'singular_label' => __( 'Post' ),
     21                'public'  => true,
     22                'show_ui' => false,
     23                '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
     24                '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
     25                'capability_type' => 'post',
     26                'hierarchical' => false,
     27                'rewrite' => false,
     28                'query_var' => false,
     29                'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),
     30        ) );
     31
     32        register_post_type( 'page', array(
     33                'label' => __( 'Pages' ),
     34                'singular_label' => __( 'Page' ),
     35                'public' => true,
     36                'show_ui' => false,
     37                '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
     38                '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
     39                'capability_type' => 'page',
     40                'hierarchical' => true,
     41                'rewrite' => false,
     42                'query_var' => false,
     43                'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
     44        ) );
     45
     46        register_post_type( 'attachment', array(
     47                'label' => __( 'Media' ),
     48                'public' => true,
     49                'show_ui' => false,
     50                '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
     51                '_edit_link' => 'media.php?attachment_id=%d', /* internal use only. don't use this when registering your own post type. */
     52                'capability_type' => 'post',
     53                'hierarchical' => false,
     54                'rewrite' => false,
     55                'query_var' => false,
     56        ) );
     57
     58        register_post_type( 'revision', array(
     59                'label' => __( 'Revisions' ),
     60                'singular_label' => __( 'Revision' ),
     61                'public' => false,
     62                '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
     63                '_edit_link' => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */
     64                'capability_type' => 'post',
     65                'hierarchical' => false,
     66                'rewrite' => false,
     67                'query_var' => false,
     68        ) );
     69
     70        register_post_type( 'nav_menu_item', array(
     71                'label' => __( 'Navigation Menu Items' ),
     72                'singular_label' => __( 'Navigation Menu Item' ),
     73                'public' => false,
     74                'show_ui' => false,
     75                '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
     76                'capability_type' => 'post',
     77                'hierarchical' => false,
     78                'rewrite' => false,
     79                'query_var' => false,
     80        ) );
     81
     82        register_post_status( 'publish', array(
     83                'label'       => _x( 'Published', 'post' ),
     84                'public'      => true,
     85                '_builtin'    => true, /* internal use only. */
     86                'label_count' => _n_noop( 'Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>' ),
     87        ) );
     88
     89        register_post_status( 'future', array(
     90                'label'       => _x( 'Scheduled', 'post' ),
     91                'protected'   => true,
     92                '_builtin'    => true, /* internal use only. */
     93                'label_count' => _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>' ),
     94        ) );
     95
     96        register_post_status( 'draft', array(
     97                'label'       => _x( 'Draft', 'post' ),
     98                'protected'   => true,
     99                '_builtin'    => true, /* internal use only. */
     100                'label_count' => _n_noop( 'Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>' ),
     101        ) );
     102
     103        register_post_status( 'pending', array(
     104                'label'       => _x( 'Pending', 'post' ),
     105                'protected'   => true,
     106                '_builtin'    => true, /* internal use only. */
     107                'label_count' => _n_noop( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>' ),
     108        ) );
     109
     110        register_post_status( 'private', array(
     111                'label'       => _x( 'Private', 'post' ),
     112                'private'     => true,
     113                '_builtin'    => true, /* internal use only. */
     114                'label_count' => _n_noop( 'Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>' ),
     115        ) );
     116
     117        register_post_status( 'trash', array(
     118                'label'       => _x( 'Trash', 'post' ),
     119                'internal'    => true,
     120                '_builtin'    => true, /* internal use only. */
     121                'label_count' => _n_noop( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>' ),
     122                'show_in_admin_status_list' => true,
     123        ) );
     124
     125        register_post_status( 'auto-draft', array(
     126                'label'    => 'auto-draft',
     127                'internal' => true,
     128                '_builtin' => true, /* internal use only. */
     129        ) );
     130
     131        register_post_status( 'inherit', array(
     132                'label'    => 'inherit',
     133                'internal' => true,
     134                '_builtin' => true, /* internal use only. */
     135                'exclude_from_search' => false,
     136        ) );
    124137}
    125138add_action( 'init', 'create_initial_post_types', 0 ); // highest priority
  • trunk/wp-includes/taxonomy.php

    r14404 r14432  
    1616 */
    1717function create_initial_taxonomies() {
    18         register_taxonomy( 'category', 'post', array(   'hierarchical' => true,
    19                                                                                                         'update_count_callback' => '_update_post_term_count',
    20                                                                                                         'label' => __('Categories'),
    21                                                                                                         'singular_label' => __('Category'),
    22                                                                                                         'query_var' => false,
    23                                                                                                         'rewrite' => false,
    24                                                                                                         'public' => true,
    25                                                                                                         'show_ui' => true,
    26                                                                                                         '_builtin' => true
    27                                                                                                 ) ) ;
     18        register_taxonomy( 'category', 'post', array(
     19                'hierarchical' => true,
     20                'update_count_callback' => '_update_post_term_count',
     21                'label' => __( 'Categories' ),
     22                'singular_label' => __( 'Category' ),
     23                'query_var' => false,
     24                'rewrite' => false,
     25                'public' => true,
     26                'show_ui' => true,
     27                '_builtin' => true,
     28        ) ) ;
    2829
    2930        register_taxonomy( 'post_tag', 'post', array(
    30                                                                                                         'hierarchical' => false,
    31                                                                                                         'update_count_callback' => '_update_post_term_count',
    32                                                                                                         'label' => __('Post Tags'),
    33                                                                                                         'singular_label' => __('Post Tag'),
    34                                                                                                         'query_var' => false,
    35                                                                                                         'rewrite' => false,
    36                                                                                                         'public' => true,
    37                                                                                                         'show_ui' => true,
    38                                                                                                         '_builtin' => true
    39                                                                                                 ) ) ;
    40 
    41         register_taxonomy( 'nav_menu', 'nav_menu_item', array(  'hierarchical' => false,
    42                                                                                                                 'label' => __('Navigation Menus'),
    43                                                                                                                 'singular_label' => __('Navigation Menu'),
    44                                                                                                                 'query_var' => false,
    45                                                                                                                 'rewrite' => false,
    46                                                                                                                 'show_ui' => false,
    47                                                                                                                 '_builtin' => true,
    48                                                                                                         ) ) ;
    49 
    50         register_taxonomy( 'link_category', 'link', array(      'hierarchical' => false,
    51                                                                                                                 'label' => __('Categories'),
    52                                                                                                                 'query_var' => false,
    53                                                                                                                 'rewrite' => false,
    54                                                                                                                 'public' => false,
    55                                                                                                                 'show_ui' => false,
    56                                                                                                                 '_builtin' => true,
    57                                                                                                         ) ) ;
     31                'hierarchical' => false,
     32                'update_count_callback' => '_update_post_term_count',
     33                'label' => __( 'Post Tags' ),
     34                'singular_label' => __( 'Post Tag' ),
     35                'query_var' => false,
     36                'rewrite' => false,
     37                'public' => true,
     38                'show_ui' => true,
     39                '_builtin' => true,
     40        ) );
     41
     42        register_taxonomy( 'nav_menu', 'nav_menu_item', array(
     43                'hierarchical' => false,
     44                'label' => __( 'Navigation Menus' ),
     45                'singular_label' => __( 'Navigation Menu' ),
     46                'query_var' => false,
     47                'rewrite' => false,
     48                'show_ui' => false,
     49                '_builtin' => true,
     50        ) ) ;
     51
     52        register_taxonomy( 'link_category', 'link', array(
     53                'hierarchical' => false,
     54                'label' => __( 'Categories' ),
     55                'query_var' => false,
     56                'rewrite' => false,
     57                'public' => false,
     58                'show_ui' => false,
     59                '_builtin' => true,
     60        ) ) ;
    5861}
    5962add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
Note: See TracChangeset for help on using the changeset viewer.