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