diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php
index 7e2d937..338fe47 100644
|
a
|
b
|
do_action( "{$taxonomy}_term_edit_form_tag" ); |
| 86 | 86 | <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" /> |
| 87 | 87 | <p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td> |
| 88 | 88 | </tr> |
| 89 | | <?php if ( !global_terms_enabled() ) { ?> |
| | 89 | <?php if ( ! global_terms_enabled() && in_array( 'slug', $tax->supports ) ) { ?> |
| 90 | 90 | <tr class="form-field term-slug-wrap"> |
| 91 | 91 | <th scope="row"><label for="slug"><?php _e( 'Slug' ); ?></label></th> |
| 92 | 92 | <?php |
| … |
… |
do_action( "{$taxonomy}_term_edit_form_tag" ); |
| 133 | 133 | </td> |
| 134 | 134 | </tr> |
| 135 | 135 | <?php endif; // is_taxonomy_hierarchical() ?> |
| | 136 | <?php if ( in_array( 'description', $tax->supports ) ) { ?> |
| 136 | 137 | <tr class="form-field term-description-wrap"> |
| 137 | 138 | <th scope="row"><label for="description"><?php _e( 'Description' ); ?></label></th> |
| 138 | 139 | <td><textarea name="description" id="description" rows="5" cols="50" class="large-text"><?php echo $tag->description; // textarea_escaped ?></textarea> |
| 139 | 140 | <p class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p></td> |
| 140 | 141 | </tr> |
| | 142 | <?php } ?> |
| 141 | 143 | <?php |
| 142 | 144 | // Back compat hooks |
| 143 | 145 | if ( 'category' == $taxonomy ) { |
diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php
index 5720b7a..1dd0b75 100644
|
a
|
b
|
if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $t |
| 217 | 217 | $help .= '<ul>' . |
| 218 | 218 | '<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.' ) . '</li>'; |
| 219 | 219 | |
| 220 | | if ( ! global_terms_enabled() ) |
| | 220 | if ( ! global_terms_enabled() && in_array( 'slug', $tax->supports ) ) { |
| 221 | 221 | $help .= '<li>' . __( '<strong>Slug</strong> - The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>'; |
| | 222 | } |
| 222 | 223 | |
| 223 | | if ( 'category' == $taxonomy ) |
| | 224 | if ( 'category' == $taxonomy ) { |
| 224 | 225 | $help .= '<li>' . __( '<strong>Parent</strong> - Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have child categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>'; |
| | 226 | } |
| | 227 | |
| | 228 | if ( in_array( 'description', $tax->supports ) ) { |
| | 229 | $help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>'; |
| | 230 | } |
| 225 | 231 | |
| 226 | | $help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>' . |
| 227 | | '</ul>' . |
| | 232 | $help .= '</ul>' . |
| 228 | 233 | '<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>'; |
| 229 | 234 | |
| 230 | 235 | get_current_screen()->add_help_tab( array( |
| … |
… |
do_action( "{$taxonomy}_term_new_form_tag" ); |
| 461 | 466 | <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" /> |
| 462 | 467 | <p><?php _e('The name is how it appears on your site.'); ?></p> |
| 463 | 468 | </div> |
| 464 | | <?php if ( ! global_terms_enabled() ) : ?> |
| | 469 | <?php if ( ! global_terms_enabled() && in_array( 'slug', $tax->supports ) ) : ?> |
| 465 | 470 | <div class="form-field term-slug-wrap"> |
| 466 | 471 | <label for="tag-slug"><?php _e( 'Slug' ); ?></label> |
| 467 | 472 | <input name="slug" id="tag-slug" type="text" value="" size="40" /> |
| … |
… |
do_action( "{$taxonomy}_term_new_form_tag" ); |
| 512 | 517 | <?php endif; ?> |
| 513 | 518 | </div> |
| 514 | 519 | <?php endif; // is_taxonomy_hierarchical() ?> |
| 515 | | <div class="form-field term-description-wrap"> |
| 516 | | <label for="tag-description"><?php _e( 'Description' ); ?></label> |
| 517 | | <textarea name="description" id="tag-description" rows="5" cols="40"></textarea> |
| 518 | | <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p> |
| 519 | | </div> |
| | 520 | |
| | 521 | <?php if ( in_array( 'description', $tax->supports ) ) { ?> |
| | 522 | <div class="form-field term-description-wrap"> |
| | 523 | <label for="tag-description"><?php _e( 'Description' ); ?></label> |
| | 524 | <textarea name="description" id="tag-description" rows="5" cols="40"></textarea> |
| | 525 | <p><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p> |
| | 526 | </div> |
| | 527 | <?php } ?> |
| 520 | 528 | |
| 521 | 529 | <?php |
| 522 | 530 | if ( ! is_taxonomy_hierarchical( $taxonomy ) ) { |
diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php
index c061fa6..a79155e 100644
|
a
|
b
|
class WP_Terms_List_Table extends WP_List_Table { |
| 164 | 164 | * @return array |
| 165 | 165 | */ |
| 166 | 166 | public function get_columns() { |
| | 167 | $taxonomy = $this->screen->taxonomy; |
| | 168 | $tax = get_taxonomy( $taxonomy ); |
| | 169 | |
| 167 | 170 | $columns = array( |
| 168 | 171 | 'cb' => '<input type="checkbox" />', |
| 169 | 172 | 'name' => _x( 'Name', 'term name' ), |
| 170 | 173 | 'description' => __( 'Description' ), |
| 171 | 174 | 'slug' => __( 'Slug' ), |
| 172 | 175 | ); |
| | 176 | foreach ( $columns as $key => $value ) { |
| | 177 | if ( ! in_array( $key, $tax->supports ) && in_array( $key, [ 'slug', 'description' ] ) ) { |
| | 178 | unset( $columns[ $key ] ); |
| | 179 | } |
| | 180 | } |
| 173 | 181 | |
| 174 | | if ( 'link_category' == $this->screen->taxonomy ) { |
| | 182 | if ( 'link_category' == $taxonomy ) { |
| 175 | 183 | $columns['links'] = __( 'Links' ); |
| 176 | 184 | } else { |
| 177 | 185 | $columns['posts'] = _x( 'Count', 'Number/count of items' ); |
| … |
… |
class WP_Terms_List_Table extends WP_List_Table { |
| 541 | 549 | <span class="title"><?php _ex( 'Name', 'term name' ); ?></span> |
| 542 | 550 | <span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span> |
| 543 | 551 | </label> |
| 544 | | <?php if ( !global_terms_enabled() ) { ?> |
| | 552 | <?php if ( ! global_terms_enabled() && in_array( 'slug', $tax->supports ) ) { ?> |
| 545 | 553 | <label> |
| 546 | 554 | <span class="title"><?php _e( 'Slug' ); ?></span> |
| 547 | 555 | <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span> |
| 548 | 556 | </label> |
| 549 | | <?php } ?> |
| | 557 | <?php } ?> |
| 550 | 558 | </div></fieldset> |
| 551 | 559 | <?php |
| 552 | 560 | |
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 70c465a..e78c2eb 100644
|
a
|
b
|
function is_taxonomy_hierarchical($taxonomy) { |
| 302 | 302 | * * If false, no meta box is shown. |
| 303 | 303 | * - capabilities - Array of capabilities for this taxonomy. |
| 304 | 304 | * * You can see accepted values in this function. |
| | 305 | * - supports - Array of certain features that this taxonomy supports. |
| | 306 | * * If not set, defaults to array containing 'slug' & 'description'. |
| 305 | 307 | * - rewrite - Triggers the handling of rewrites for this taxonomy. Defaults to true, using $taxonomy as slug. |
| 306 | 308 | * * To prevent rewrite, set to false. |
| 307 | 309 | * * To specify rewrite rules, an array can be passed with any of these keys |
| … |
… |
function register_taxonomy( $taxonomy, $object_type, $args = array() ) { |
| 351 | 353 | 'show_admin_column' => false, |
| 352 | 354 | 'meta_box_cb' => null, |
| 353 | 355 | 'capabilities' => array(), |
| | 356 | 'supports' => array( 'slug', 'description' ), |
| 354 | 357 | 'rewrite' => true, |
| 355 | 358 | 'query_var' => $taxonomy, |
| 356 | 359 | 'update_count_callback' => '', |
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index e78c2eb..26ec473 100644
|
a
|
b
|
function create_initial_taxonomies() { |
| 63 | 63 | 'show_ui' => true, |
| 64 | 64 | 'show_admin_column' => true, |
| 65 | 65 | '_builtin' => true, |
| | 66 | 'supports' => array(), |
| 66 | 67 | ) ); |
| 67 | 68 | |
| 68 | 69 | register_taxonomy( 'post_tag', 'post', array( |