]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/edit-tags.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-admin / edit-tags.php
1 <?php
2 /**
3  * Edit Tags Administration Screen.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 /** WordPress Administration Bootstrap */
10 require_once( dirname( __FILE__ ) . '/admin.php' );
11
12 if ( ! $taxnow )
13         wp_die( __( 'Invalid taxonomy' ) );
14
15 $tax = get_taxonomy( $taxnow );
16
17 if ( ! $tax )
18         wp_die( __( 'Invalid taxonomy' ) );
19
20 if ( ! current_user_can( $tax->cap->manage_terms ) )
21         wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
22
23 /**
24  * $post_type is set when the WP_Terms_List_Table instance is created
25  *
26  * @global string $post_type
27  */
28 global $post_type;
29
30 $wp_list_table = _get_list_table('WP_Terms_List_Table');
31 $pagenum = $wp_list_table->get_pagenum();
32
33 $title = $tax->labels->name;
34
35 if ( 'post' != $post_type ) {
36         $parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
37         $submenu_file = "edit-tags.php?taxonomy=$taxonomy&amp;post_type=$post_type";
38 } elseif ( 'link_category' == $tax->name ) {
39         $parent_file = 'link-manager.php';
40         $submenu_file = 'edit-tags.php?taxonomy=link_category';
41 } else {
42         $parent_file = 'edit.php';
43         $submenu_file = "edit-tags.php?taxonomy=$taxonomy";
44 }
45
46 add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) );
47
48 $location = false;
49
50 switch ( $wp_list_table->current_action() ) {
51
52 case 'add-tag':
53
54         check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
55
56         if ( !current_user_can( $tax->cap->edit_terms ) )
57                 wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
58
59         $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
60         $location = 'edit-tags.php?taxonomy=' . $taxonomy;
61         if ( 'post' != $post_type )
62                 $location .= '&post_type=' . $post_type;
63
64         if ( $referer = wp_get_original_referer() ) {
65                 if ( false !== strpos( $referer, 'edit-tags.php' ) )
66                         $location = $referer;
67         }
68
69         if ( $ret && !is_wp_error( $ret ) )
70                 $location = add_query_arg( 'message', 1, $location );
71         else
72                 $location = add_query_arg( array( 'error' => true, 'message' => 4 ), $location );
73
74         break;
75
76 case 'delete':
77         $location = 'edit-tags.php?taxonomy=' . $taxonomy;
78         if ( 'post' != $post_type )
79                 $location .= '&post_type=' . $post_type;
80         if ( $referer = wp_get_referer() ) {
81                 if ( false !== strpos( $referer, 'edit-tags.php' ) )
82                         $location = $referer;
83         }
84
85         if ( ! isset( $_REQUEST['tag_ID'] ) ) {
86                 break;
87         }
88
89         $tag_ID = (int) $_REQUEST['tag_ID'];
90         check_admin_referer( 'delete-tag_' . $tag_ID );
91
92         if ( !current_user_can( $tax->cap->delete_terms ) )
93                 wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
94
95         wp_delete_term( $tag_ID, $taxonomy );
96
97         $location = add_query_arg( 'message', 2, $location );
98
99         break;
100
101 case 'bulk-delete':
102         check_admin_referer( 'bulk-tags' );
103
104         if ( !current_user_can( $tax->cap->delete_terms ) )
105                 wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
106
107         $tags = (array) $_REQUEST['delete_tags'];
108         foreach ( $tags as $tag_ID ) {
109                 wp_delete_term( $tag_ID, $taxonomy );
110         }
111
112         $location = 'edit-tags.php?taxonomy=' . $taxonomy;
113         if ( 'post' != $post_type )
114                 $location .= '&post_type=' . $post_type;
115         if ( $referer = wp_get_referer() ) {
116                 if ( false !== strpos( $referer, 'edit-tags.php' ) )
117                         $location = $referer;
118         }
119
120         $location = add_query_arg( 'message', 6, $location );
121
122         break;
123
124 case 'edit':
125         $title = $tax->labels->edit_item;
126
127         $tag_ID = (int) $_REQUEST['tag_ID'];
128
129         $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
130         if ( ! $tag )
131                 wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
132         require_once( ABSPATH . 'wp-admin/admin-header.php' );
133         include( ABSPATH . 'wp-admin/edit-tag-form.php' );
134         include( ABSPATH . 'wp-admin/admin-footer.php' );
135
136         exit;
137
138 case 'editedtag':
139         $tag_ID = (int) $_POST['tag_ID'];
140         check_admin_referer( 'update-tag_' . $tag_ID );
141
142         if ( !current_user_can( $tax->cap->edit_terms ) )
143                 wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
144
145         $tag = get_term( $tag_ID, $taxonomy );
146         if ( ! $tag )
147                 wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
148
149         $ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
150
151         $location = 'edit-tags.php?taxonomy=' . $taxonomy;
152         if ( 'post' != $post_type )
153                 $location .= '&post_type=' . $post_type;
154
155         if ( $referer = wp_get_original_referer() ) {
156                 if ( false !== strpos( $referer, 'edit-tags.php' ) )
157                         $location = $referer;
158         }
159
160         if ( $ret && !is_wp_error( $ret ) )
161                 $location = add_query_arg( 'message', 3, $location );
162         else
163                 $location = add_query_arg( array( 'error' => true, 'message' => 5 ), $location );
164         break;
165 }
166
167 if ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) {
168         $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) );
169 }
170
171 if ( $location ) {
172         if ( ! empty( $_REQUEST['paged'] ) ) {
173                 $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
174         }
175         wp_redirect( $location );
176         exit;
177 }
178
179 $wp_list_table->prepare_items();
180 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
181
182 if ( $pagenum > $total_pages && $total_pages > 0 ) {
183         wp_redirect( add_query_arg( 'paged', $total_pages ) );
184         exit;
185 }
186
187 wp_enqueue_script('admin-tags');
188 if ( current_user_can($tax->cap->edit_terms) )
189         wp_enqueue_script('inline-edit-tax');
190
191 if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy  ) {
192         $help ='';
193         if ( 'category' == $taxonomy )
194                 $help = '<p>' . sprintf(__( 'You can use categories to define sections of your site and group related posts. The default category is &#8220;Uncategorized&#8221; until you change it in your <a href="%s">writing settings</a>.' ) , 'options-writing.php' ) . '</p>';
195         elseif ( 'link_category' == $taxonomy )
196                 $help = '<p>' . __( 'You can create groups of links by using Link Categories. Link Category names must be unique and Link Categories are separate from the categories you use for posts.' ) . '</p>';
197         else
198                 $help = '<p>' . __( 'You can assign keywords to your posts using <strong>tags</strong>. Unlike categories, tags have no hierarchy, meaning there&#8217;s no relationship from one tag to another.' ) . '</p>';
199
200         if ( 'link_category' == $taxonomy )
201                 $help .= '<p>' . __( 'You can delete Link Categories in the Bulk Action pull-down, but that action does not delete the links within the category. Instead, it moves them to the default Link Category.' ) . '</p>';
202         else
203                 $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>';
204
205         get_current_screen()->add_help_tab( array(
206                 'id'      => 'overview',
207                 'title'   => __('Overview'),
208                 'content' => $help,
209         ) );
210
211         if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
212                 if ( 'category' == $taxonomy )
213                         $help = '<p>' . __( 'When adding a new category on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
214                 else
215                         $help = '<p>' . __( 'When adding a new tag on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
216
217                 $help .= '<ul>' .
218                 '<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.' ) . '</li>';
219
220                 if ( ! global_terms_enabled() )
221                         $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>';
222
223                 if ( 'category' == $taxonomy )
224                         $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>';
225
226                 $help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
227                 '</ul>' .
228                 '<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
230                 get_current_screen()->add_help_tab( array(
231                         'id'      => 'adding-terms',
232                         'title'   => 'category' == $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),
233                         'content' => $help,
234                 ) );
235         }
236
237         $help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
238
239         if ( 'category' == $taxonomy )
240                 $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Categories_Screen" target="_blank">Documentation on Categories</a>' ) . '</p>';
241         elseif ( 'link_category' == $taxonomy )
242                 $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Links_Link_Categories_Screen" target="_blank">Documentation on Link Categories</a>' ) . '</p>';
243         else
244                 $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Tags_Screen" target="_blank">Documentation on Tags</a>' ) . '</p>';
245
246         $help .= '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
247
248         get_current_screen()->set_help_sidebar( $help );
249
250         unset( $help );
251 }
252
253 require_once( ABSPATH . 'wp-admin/admin-header.php' );
254
255 if ( !current_user_can($tax->cap->edit_terms) )
256         wp_die( __('You are not allowed to edit this item.') );
257
258 $messages = array();
259 $messages['_item'] = array(
260         0 => '', // Unused. Messages start at index 1.
261         1 => __( 'Item added.' ),
262         2 => __( 'Item deleted.' ),
263         3 => __( 'Item updated.' ),
264         4 => __( 'Item not added.' ),
265         5 => __( 'Item not updated.' ),
266         6 => __( 'Items deleted.' )
267 );
268 $messages['category'] = array(
269         0 => '', // Unused. Messages start at index 1.
270         1 => __( 'Category added.' ),
271         2 => __( 'Category deleted.' ),
272         3 => __( 'Category updated.' ),
273         4 => __( 'Category not added.' ),
274         5 => __( 'Category not updated.' ),
275         6 => __( 'Categories deleted.' )
276 );
277 $messages['post_tag'] = array(
278         0 => '', // Unused. Messages start at index 1.
279         1 => __( 'Tag added.' ),
280         2 => __( 'Tag deleted.' ),
281         3 => __( 'Tag updated.' ),
282         4 => __( 'Tag not added.' ),
283         5 => __( 'Tag not updated.' ),
284         6 => __( 'Tags deleted.' )
285 );
286
287 /**
288  * Filter the messages displayed when a tag is updated.
289  *
290  * @since 3.7.0
291  *
292  * @param array $messages The messages to be displayed.
293  */
294 $messages = apply_filters( 'term_updated_messages', $messages );
295
296 $message = false;
297 if ( isset( $_REQUEST['message'] ) && ( $msg = (int) $_REQUEST['message'] ) ) {
298         if ( isset( $messages[ $taxonomy ][ $msg ] ) )
299                 $message = $messages[ $taxonomy ][ $msg ];
300         elseif ( ! isset( $messages[ $taxonomy ] ) && isset( $messages['_item'][ $msg ] ) )
301                 $message = $messages['_item'][ $msg ];
302 }
303
304 $class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated';
305
306 if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {
307         $import_link = admin_url( 'admin.php?import=wpcat2tag' );
308 } else {
309         $import_link = admin_url( 'import.php' );
310 }
311
312 ?>
313
314 <div class="wrap nosubsub">
315 <h1><?php echo esc_html( $title );
316 if ( !empty($_REQUEST['s']) )
317         printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( wp_unslash($_REQUEST['s']) ) ); ?>
318 </h1>
319
320 <?php if ( $message ) : ?>
321 <div id="message" class="<?php echo $class; ?> notice is-dismissible"><p><?php echo $message; ?></p></div>
322 <?php $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] );
323 endif; ?>
324 <div id="ajax-response"></div>
325
326 <form class="search-form" method="get">
327 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
328 <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
329
330 <?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>
331
332 </form>
333 <br class="clear" />
334
335 <div id="col-container">
336
337 <div id="col-right">
338 <div class="col-wrap">
339 <form id="posts-filter" method="post">
340 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
341 <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
342
343 <?php $wp_list_table->display(); ?>
344
345 <br class="clear" />
346 </form>
347
348 <?php if ( 'category' == $taxonomy ) : ?>
349 <div class="form-wrap">
350 <p>
351         <?php
352         /** This filter is documented in wp-includes/category-template.php */
353         printf( __( '<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.' ), apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) );
354         ?>
355 </p>
356 <?php if ( current_user_can( 'import' ) ) : ?>
357 <p><?php printf( __( 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.' ), esc_url( $import_link ) ) ?></p>
358 <?php endif; ?>
359 </div>
360 <?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
361 <div class="form-wrap">
362 <p><?php printf( __( 'Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.' ), esc_url( $import_link ) ) ;?></p>
363 </div>
364 <?php endif;
365
366 /**
367  * Fires after the taxonomy list table.
368  *
369  * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
370  *
371  * @since 3.0.0
372  *
373  * @param string $taxonomy The taxonomy name.
374  */
375 do_action( "after-{$taxonomy}-table", $taxonomy );
376 ?>
377
378 </div>
379 </div><!-- /col-right -->
380
381 <div id="col-left">
382 <div class="col-wrap">
383
384 <?php
385
386 if ( !is_null( $tax->labels->popular_items ) ) {
387         if ( current_user_can( $tax->cap->edit_terms ) )
388                 $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'post_type' => $post_type, 'echo' => false, 'link' => 'edit' ) );
389         else
390                 $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) );
391
392         if ( $tag_cloud ) :
393         ?>
394 <div class="tagcloud">
395 <h3><?php echo $tax->labels->popular_items; ?></h3>
396 <?php echo $tag_cloud; unset( $tag_cloud ); ?>
397 </div>
398 <?php
399 endif;
400 }
401
402 if ( current_user_can($tax->cap->edit_terms) ) {
403         if ( 'category' == $taxonomy ) {
404                 /**
405                  * Fires before the Add Category form.
406                  *
407                  * @since 2.1.0
408                  * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
409                  *
410                  * @param object $arg Optional arguments cast to an object.
411                  */
412                 do_action( 'add_category_form_pre', (object) array( 'parent' => 0 ) );
413         } elseif ( 'link_category' == $taxonomy ) {
414                 /**
415                  * Fires before the link category form.
416                  *
417                  * @since 2.3.0
418                  * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
419                  *
420                  * @param object $arg Optional arguments cast to an object.
421                  */
422                 do_action( 'add_link_category_form_pre', (object) array( 'parent' => 0 ) );
423         } else {
424                 /**
425                  * Fires before the Add Tag form.
426                  *
427                  * @since 2.5.0
428                  * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
429                  *
430                  * @param string $taxonomy The taxonomy slug.
431                  */
432                 do_action( 'add_tag_form_pre', $taxonomy );
433         }
434
435         /**
436          * Fires before the Add Term form for all taxonomies.
437          *
438          * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
439          *
440          * @since 3.0.0
441          *
442          * @param string $taxonomy The taxonomy slug.
443          */
444         do_action( "{$taxonomy}_pre_add_form", $taxonomy );
445 ?>
446
447 <div class="form-wrap">
448 <h3><?php echo $tax->labels->add_new_item; ?></h3>
449 <form id="addtag" method="post" action="edit-tags.php" class="validate"
450 <?php
451 /**
452  * Fires at the beginning of the Add Tag form.
453  *
454  * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
455  *
456  * @since 3.7.0
457  */
458 do_action( "{$taxonomy}_term_new_form_tag" );
459 ?>>
460 <input type="hidden" name="action" value="add-tag" />
461 <input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
462 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
463 <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
464 <?php wp_nonce_field('add-tag', '_wpnonce_add-tag'); ?>
465
466 <div class="form-field form-required term-name-wrap">
467         <label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label>
468         <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
469         <p><?php _e('The name is how it appears on your site.'); ?></p>
470 </div>
471 <?php if ( ! global_terms_enabled() ) : ?>
472 <div class="form-field term-slug-wrap">
473         <label for="tag-slug"><?php _e( 'Slug' ); ?></label>
474         <input name="slug" id="tag-slug" type="text" value="" size="40" />
475         <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
476 </div>
477 <?php endif; // global_terms_enabled() ?>
478 <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
479 <div class="form-field term-parent-wrap">
480         <label for="parent"><?php _ex( 'Parent', 'term parent' ); ?></label>
481         <?php
482         $dropdown_args = array(
483                 'hide_empty'       => 0,
484                 'hide_if_empty'    => false,
485                 'taxonomy'         => $taxonomy,
486                 'name'             => 'parent',
487                 'orderby'          => 'name',
488                 'hierarchical'     => true,
489                 'show_option_none' => __( 'None' ),
490         );
491
492         /**
493          * Filter the taxonomy parent drop-down on the Edit Term page.
494          *
495          * @since 3.7.0
496          * @since 4.2.0 Added `$context` parameter.
497          *
498          * @param array  $dropdown_args {
499          *     An array of taxonomy parent drop-down arguments.
500          *
501          *     @type int|bool $hide_empty       Whether to hide terms not attached to any posts. Default 0|false.
502          *     @type bool     $hide_if_empty    Whether to hide the drop-down if no terms exist. Default false.
503          *     @type string   $taxonomy         The taxonomy slug.
504          *     @type string   $name             Value of the name attribute to use for the drop-down select element.
505          *                                      Default 'parent'.
506          *     @type string   $orderby          The field to order by. Default 'name'.
507          *     @type bool     $hierarchical     Whether the taxonomy is hierarchical. Default true.
508          *     @type string   $show_option_none Label to display if there are no terms. Default 'None'.
509          * }
510          * @param string $taxonomy The taxonomy slug.
511          * @param string $context  Filter context. Accepts 'new' or 'edit'.
512          */
513         $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' );
514
515         wp_dropdown_categories( $dropdown_args );
516         ?>
517         <?php if ( 'category' == $taxonomy ) : // @todo: Generic text for hierarchical taxonomies ?>
518                 <p><?php _e('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.'); ?></p>
519         <?php endif; ?>
520 </div>
521 <?php endif; // is_taxonomy_hierarchical() ?>
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
528 <?php
529 if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
530         /**
531          * Fires after the Add Tag form fields for non-hierarchical taxonomies.
532          *
533          * @since 3.0.0
534          *
535          * @param string $taxonomy The taxonomy slug.
536          */
537         do_action( 'add_tag_form_fields', $taxonomy );
538 }
539
540 /**
541  * Fires after the Add Term form fields.
542  *
543  * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
544  *
545  * @since 3.0.0
546  *
547  * @param string $taxonomy The taxonomy slug.
548  */
549 do_action( "{$taxonomy}_add_form_fields", $taxonomy );
550
551 submit_button( $tax->labels->add_new_item );
552
553 if ( 'category' == $taxonomy ) {
554         /**
555          * Fires at the end of the Edit Category form.
556          *
557          * @since 2.1.0
558          * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
559          *
560          * @param object $arg Optional arguments cast to an object.
561          */
562         do_action( 'edit_category_form', (object) array( 'parent' => 0 ) );
563 } elseif ( 'link_category' == $taxonomy ) {
564         /**
565          * Fires at the end of the Edit Link form.
566          *
567          * @since 2.3.0
568          * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
569          *
570          * @param object $arg Optional arguments cast to an object.
571          */
572         do_action( 'edit_link_category_form', (object) array( 'parent' => 0 ) );
573 } else {
574         /**
575          * Fires at the end of the Add Tag form.
576          *
577          * @since 2.7.0
578          * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
579          *
580          * @param string $taxonomy The taxonomy slug.
581          */
582         do_action( 'add_tag_form', $taxonomy );
583 }
584
585 /**
586  * Fires at the end of the Add Term form for all taxonomies.
587  *
588  * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
589  *
590  * @since 3.0.0
591  *
592  * @param string $taxonomy The taxonomy slug.
593  */
594 do_action( "{$taxonomy}_add_form", $taxonomy );
595 ?>
596 </form></div>
597 <?php } ?>
598
599 </div>
600 </div><!-- /col-left -->
601
602 </div><!-- /col-container -->
603 </div><!-- /wrap -->
604
605 <?php if ( ! wp_is_mobile() ) : ?>
606 <script type="text/javascript">
607 try{document.forms.addtag['tag-name'].focus();}catch(e){}
608 </script>
609 <?php
610 endif;
611
612 $wp_list_table->inline_edit();
613
614 include( ABSPATH . 'wp-admin/admin-footer.php' );