Make WordPress Core

Changeset 19513


Ignore:
Timestamp:
12/01/2011 01:51:34 AM (15 years ago)
Author:
nacin
Message:

Split chunk of help text on edit-tags.php into 'Adding Categories' and 'Adding Tags' tabs, respectively. see #19020.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-tags.php

    r19474 r19513  
    200200                $help .='<p>' . __( 'What&#8217;s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.' ) . '</p>';
    201201
    202         if ( 'category' == $taxonomy )
    203                 $help .= '<p>' . __( 'When adding a new category on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
    204         elseif ( 'post_tag' == $taxonomy )
    205                 $help .= '<p>' . __( 'When adding a new tag on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
    206 
    207         if ( 'category' == $taxonomy || 'post_tag' == $taxonomy  )
    208 
    209                 $help .= '<ul>' .
    210                 '<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.' ) . '</li>';
    211 
    212         if ( ! global_terms_enabled()  )
    213         if ( 'category' == $taxonomy || 'post_tag' == $taxonomy  )
    214                 $help .= '<li>' . __( '<strong>Slug</strong> - The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
    215 
    216         if ( 'category' == $taxonomy )
    217                 $help .= '<li>' . __( '<strong>Parent</strong> - Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>';
    218 
    219         if ( 'category' == $taxonomy || 'post_tag' == $taxonomy  )
    220                 $help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
    221                 '</ul>' .
    222                 '<p>' . __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.' ) . '</p>';
    223 
    224202        get_current_screen()->add_help_tab( array(
    225203                'id'      => 'help-overview',
    … …  
    228206        ) );
    229207
     208        if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
     209                if ( 'category' == $taxonomy )
     210                        $help = '<p>' . __( 'When adding a new category on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
     211                else
     212                        $help = '<p>' . __( 'When adding a new tag on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
     213
     214                $help .= '<ul>' .
     215                '<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.' ) . '</li>';
     216
     217                if ( ! global_terms_enabled() )
     218                        $help .= '<li>' . __( '<strong>Slug</strong> - The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
     219
     220                if ( 'category' == $taxonomy )
     221                        $help .= '<li>' . __( '<strong>Parent</strong> - Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>';
     222
     223                $help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
     224                '</ul>' .
     225                '<p>' . __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.' ) . '</p>';
     226       
     227                get_current_screen()->add_help_tab( array(
     228                        'id'      => 'adding-terms',
     229                        'title'   => 'category' == $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),
     230                        'content' => $help,
     231                ) );
     232        }
     233
    230234        $help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
    231235
    … …  
    241245        get_current_screen()->set_help_sidebar( $help );
    242246
    243         unset($help);
     247        unset( $help );
    244248}
    245249
Note: See TracChangeset for help on using the changeset viewer.