PageRenderTime 61ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-admin/edit-tags.php

https://github.com/tibor-kulcar/evadekor
PHP | 592 lines | 365 code | 95 blank | 132 comment | 96 complexity | 0ae2c69a5acc1d86f7f60bff8ee1b5ec MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, AGPL-1.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?' ) );
  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. switch ( $wp_list_table->current_action() ) {
  32. case 'add-tag':
  33. check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
  34. if ( !current_user_can( $tax->cap->edit_terms ) )
  35. wp_die( __( 'Cheatin&#8217; uh?' ) );
  36. $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
  37. $location = 'edit-tags.php?taxonomy=' . $taxonomy;
  38. if ( 'post' != $post_type )
  39. $location .= '&post_type=' . $post_type;
  40. if ( $referer = wp_get_original_referer() ) {
  41. if ( false !== strpos( $referer, 'edit-tags.php' ) )
  42. $location = $referer;
  43. }
  44. if ( $ret && !is_wp_error( $ret ) )
  45. $location = add_query_arg( 'message', 1, $location );
  46. else
  47. $location = add_query_arg( 'message', 4, $location );
  48. wp_redirect( $location );
  49. exit;
  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. wp_redirect( $location );
  60. exit;
  61. }
  62. $tag_ID = (int) $_REQUEST['tag_ID'];
  63. check_admin_referer( 'delete-tag_' . $tag_ID );
  64. if ( !current_user_can( $tax->cap->delete_terms ) )
  65. wp_die( __( 'Cheatin&#8217; uh?' ) );
  66. wp_delete_term( $tag_ID, $taxonomy );
  67. $location = add_query_arg( 'message', 2, $location );
  68. wp_redirect( $location );
  69. exit;
  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?' ) );
  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. wp_redirect( $location );
  87. exit;
  88. case 'edit':
  89. $title = $tax->labels->edit_item;
  90. $tag_ID = (int) $_REQUEST['tag_ID'];
  91. $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
  92. if ( ! $tag )
  93. wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
  94. require_once( ABSPATH . 'wp-admin/admin-header.php' );
  95. include( ABSPATH . 'wp-admin/edit-tag-form.php' );
  96. break;
  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?' ) );
  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. wp_redirect( $location );
  118. exit;
  119. default:
  120. if ( ! empty($_REQUEST['_wp_http_referer']) ) {
  121. $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) );
  122. if ( ! empty( $_REQUEST['paged'] ) )
  123. $location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
  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. <?php
  349. /**
  350. * Fires at the beginning of the Add Tag form.
  351. *
  352. * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
  353. *
  354. * @since 3.7.0
  355. */
  356. ?>
  357. <form id="addtag" method="post" action="edit-tags.php" class="validate"<?php do_action( "{$taxonomy}_term_new_form_tag" ); ?>>
  358. <input type="hidden" name="action" value="add-tag" />
  359. <input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
  360. <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
  361. <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
  362. <?php wp_nonce_field('add-tag', '_wpnonce_add-tag'); ?>
  363. <div class="form-field form-required">
  364. <label for="tag-name"><?php _ex('Name', 'Taxonomy Name'); ?></label>
  365. <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
  366. <p><?php _e('The name is how it appears on your site.'); ?></p>
  367. </div>
  368. <?php if ( ! global_terms_enabled() ) : ?>
  369. <div class="form-field">
  370. <label for="tag-slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label>
  371. <input name="slug" id="tag-slug" type="text" value="" size="40" />
  372. <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>
  373. </div>
  374. <?php endif; // global_terms_enabled() ?>
  375. <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
  376. <div class="form-field">
  377. <label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label>
  378. <?php
  379. $dropdown_args = array(
  380. 'hide_empty' => 0,
  381. 'hide_if_empty' => false,
  382. 'taxonomy' => $taxonomy,
  383. 'name' => 'parent',
  384. 'orderby' => 'name',
  385. 'hierarchical' => true,
  386. 'show_option_none' => __( 'None' ),
  387. );
  388. /**
  389. * Filter the taxonomy parent drop-down on the Edit Term page.
  390. *
  391. * @since 3.7.0
  392. *
  393. * @param array $dropdown_args {
  394. * An array of taxonomy parent drop-down arguments.
  395. *
  396. * @type int|bool $hide_empty Whether to hide terms not attached to any posts. Default 0|false.
  397. * @type bool $hide_if_empty Whether to hide the drop-down if no terms exist. Default false.
  398. * @type string $taxonomy The taxonomy slug.
  399. * @type string $name Value of the name attribute to use for the drop-down select element.
  400. * Default 'parent'.
  401. * @type string $orderby The field to order by. Default 'name'.
  402. * @type bool $hierarchical Whether the taxonomy is hierarchical. Default true.
  403. * @type string $show_option_none Label to display if there are no terms. Default 'None'.
  404. * }
  405. * @param string $taxonomy The taxonomy slug.
  406. */
  407. $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy );
  408. wp_dropdown_categories( $dropdown_args );
  409. ?>
  410. <?php if ( 'category' == $taxonomy ) : // @todo: Generic text for hierarchical taxonomies ?>
  411. <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>
  412. <?php endif; ?>
  413. </div>
  414. <?php endif; // is_taxonomy_hierarchical() ?>
  415. <div class="form-field">
  416. <label for="tag-description"><?php _ex('Description', 'Taxonomy Description'); ?></label>
  417. <textarea name="description" id="tag-description" rows="5" cols="40"></textarea>
  418. <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
  419. </div>
  420. <?php
  421. if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
  422. /**
  423. * Fires after the Add Tag form fields for non-hierarchical taxonomies.
  424. *
  425. * @since 3.0.0
  426. *
  427. * @param string $taxonomy The taxonomy slug.
  428. */
  429. do_action( 'add_tag_form_fields', $taxonomy );
  430. }
  431. /**
  432. * Fires after the Add Term form fields for hierarchical taxonomies.
  433. *
  434. * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
  435. *
  436. * @since 3.0.0
  437. *
  438. * @param string $taxonomy The taxonomy slug.
  439. */
  440. do_action( "{$taxonomy}_add_form_fields", $taxonomy );
  441. submit_button( $tax->labels->add_new_item );
  442. if ( 'category' == $taxonomy ) {
  443. /**
  444. * Fires at the end of the Edit Category form.
  445. *
  446. * @since 2.1.0
  447. * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
  448. *
  449. * @param object $arg Optional arguments cast to an object.
  450. */
  451. do_action( 'edit_category_form', (object) array( 'parent' => 0 ) );
  452. } elseif ( 'link_category' == $taxonomy ) {
  453. /**
  454. * Fires at the end of the Edit Link form.
  455. *
  456. * @since 2.3.0
  457. * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
  458. *
  459. * @param object $arg Optional arguments cast to an object.
  460. */
  461. do_action( 'edit_link_category_form', (object) array( 'parent' => 0 ) );
  462. } else {
  463. /**
  464. * Fires at the end of the Add Tag form.
  465. *
  466. * @since 2.7.0
  467. * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
  468. *
  469. * @param string $taxonomy The taxonomy slug.
  470. */
  471. do_action( 'add_tag_form', $taxonomy );
  472. }
  473. /**
  474. * Fires at the end of the Add Term form for all taxonomies.
  475. *
  476. * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
  477. *
  478. * @since 3.0.0
  479. *
  480. * @param string $taxonomy The taxonomy slug.
  481. */
  482. do_action( "{$taxonomy}_add_form", $taxonomy );
  483. ?>
  484. </form></div>
  485. <?php } ?>
  486. </div>
  487. </div><!-- /col-left -->
  488. </div><!-- /col-container -->
  489. </div><!-- /wrap -->
  490. <script type="text/javascript">
  491. try{document.forms.addtag['tag-name'].focus();}catch(e){}
  492. </script>
  493. <?php $wp_list_table->inline_edit(); ?>
  494. <?php
  495. break;
  496. }
  497. include( ABSPATH . 'wp-admin/admin-footer.php' );