PageRenderTime 46ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-admin/edit-tags.php

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