PageRenderTime 138ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-admin/edit-tags.php

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