PageRenderTime 53ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-admin/edit-tags.php

https://github.com/clayreiche/riverridgepal.com
PHP | 594 lines | 366 code | 97 blank | 131 comment | 96 complexity | da48be994420bbce8e799603fc353165 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. break;
  51. case 'delete':
  52. $location = 'edit-tags.php?taxonomy=' . $taxonomy;
  53. if ( 'post' != $post_type )
  54. $location .= '&post_type=' . $post_type;
  55. if ( $referer = wp_get_referer() ) {
  56. if ( false !== strpos( $referer, 'edit-tags.php' ) )
  57. $location = $referer;
  58. }
  59. if ( !isset( $_REQUEST['tag_ID'] ) ) {
  60. wp_redirect( $location );
  61. exit;
  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?' ) );
  67. wp_delete_term( $tag_ID, $taxonomy );
  68. $location = add_query_arg( 'message', 2, $location );
  69. wp_redirect( $location );
  70. exit;
  71. break;
  72. case 'bulk-delete':
  73. check_admin_referer( 'bulk-tags' );
  74. if ( !current_user_can( $tax->cap->delete_terms ) )
  75. wp_die( __( 'Cheatin&#8217; uh?' ) );
  76. $tags = (array) $_REQUEST['delete_tags'];
  77. foreach ( $tags as $tag_ID ) {
  78. wp_delete_term( $tag_ID, $taxonomy );
  79. }
  80. $location = 'edit-tags.php?taxonomy=' . $taxonomy;
  81. if ( 'post' != $post_type )
  82. $location .= '&post_type=' . $post_type;
  83. if ( $referer = wp_get_referer() ) {
  84. if ( false !== strpos( $referer, 'edit-tags.php' ) )
  85. $location = $referer;
  86. }
  87. $location = add_query_arg( 'message', 6, $location );
  88. wp_redirect( $location );
  89. exit;
  90. break;
  91. case 'edit':
  92. $title = $tax->labels->edit_item;
  93. $tag_ID = (int) $_REQUEST['tag_ID'];
  94. $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
  95. if ( ! $tag )
  96. wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
  97. require_once( ABSPATH . 'wp-admin/admin-header.php' );
  98. include( ABSPATH . 'wp-admin/edit-tag-form.php' );
  99. break;
  100. case 'editedtag':
  101. $tag_ID = (int) $_POST['tag_ID'];
  102. check_admin_referer( 'update-tag_' . $tag_ID );
  103. if ( !current_user_can( $tax->cap->edit_terms ) )
  104. wp_die( __( 'Cheatin&#8217; uh?' ) );
  105. $tag = get_term( $tag_ID, $taxonomy );
  106. if ( ! $tag )
  107. wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
  108. $ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
  109. $location = 'edit-tags.php?taxonomy=' . $taxonomy;
  110. if ( 'post' != $post_type )
  111. $location .= '&post_type=' . $post_type;
  112. if ( $referer = wp_get_original_referer() ) {
  113. if ( false !== strpos( $referer, 'edit-tags.php' ) )
  114. $location = $referer;
  115. }
  116. if ( $ret && !is_wp_error( $ret ) )
  117. $location = add_query_arg( 'message', 3, $location );
  118. else
  119. $location = add_query_arg( 'message', 5, $location );
  120. wp_redirect( $location );
  121. exit;
  122. break;
  123. default:
  124. if ( ! empty($_REQUEST['_wp_http_referer']) ) {
  125. $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) );
  126. if ( ! empty( $_REQUEST['paged'] ) )
  127. $location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
  128. wp_redirect( $location );
  129. exit;
  130. }
  131. $wp_list_table->prepare_items();
  132. $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
  133. if ( $pagenum > $total_pages && $total_pages > 0 ) {
  134. wp_redirect( add_query_arg( 'paged', $total_pages ) );
  135. exit;
  136. }
  137. wp_enqueue_script('admin-tags');
  138. if ( current_user_can($tax->cap->edit_terms) )
  139. wp_enqueue_script('inline-edit-tax');
  140. if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy ) {
  141. $help ='';
  142. if ( 'category' == $taxonomy )
  143. $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>';
  144. elseif ( 'link_category' == $taxonomy )
  145. $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>';
  146. else
  147. $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>';
  148. if ( 'link_category' == $taxonomy )
  149. $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>';
  150. else
  151. $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>';
  152. get_current_screen()->add_help_tab( array(
  153. 'id' => 'overview',
  154. 'title' => __('Overview'),
  155. 'content' => $help,
  156. ) );
  157. if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
  158. if ( 'category' == $taxonomy )
  159. $help = '<p>' . __( 'When adding a new category on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
  160. else
  161. $help = '<p>' . __( 'When adding a new tag on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
  162. $help .= '<ul>' .
  163. '<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.' ) . '</li>';
  164. if ( ! global_terms_enabled() )
  165. $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>';
  166. if ( 'category' == $taxonomy )
  167. $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>';
  168. $help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
  169. '</ul>' .
  170. '<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>';
  171. get_current_screen()->add_help_tab( array(
  172. 'id' => 'adding-terms',
  173. 'title' => 'category' == $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),
  174. 'content' => $help,
  175. ) );
  176. }
  177. $help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
  178. if ( 'category' == $taxonomy )
  179. $help .= '<p>' . __( '<a href="http://codex.wordpress.org/Posts_Categories_Screen" target="_blank">Documentation on Categories</a>' ) . '</p>';
  180. elseif ( 'link_category' == $taxonomy )
  181. $help .= '<p>' . __( '<a href="http://codex.wordpress.org/Links_Link_Categories_Screen" target="_blank">Documentation on Link Categories</a>' ) . '</p>';
  182. else
  183. $help .= '<p>' . __( '<a href="http://codex.wordpress.org/Posts_Tags_Screen" target="_blank">Documentation on Tags</a>' ) . '</p>';
  184. $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
  185. get_current_screen()->set_help_sidebar( $help );
  186. unset( $help );
  187. }
  188. require_once( ABSPATH . 'wp-admin/admin-header.php' );
  189. if ( !current_user_can($tax->cap->edit_terms) )
  190. wp_die( __('You are not allowed to edit this item.') );
  191. $messages = array();
  192. $messages['_item'] = array(
  193. 0 => '', // Unused. Messages start at index 1.
  194. 1 => __( 'Item added.' ),
  195. 2 => __( 'Item deleted.' ),
  196. 3 => __( 'Item updated.' ),
  197. 4 => __( 'Item not added.' ),
  198. 5 => __( 'Item not updated.' ),
  199. 6 => __( 'Items deleted.' )
  200. );
  201. $messages['category'] = array(
  202. 0 => '', // Unused. Messages start at index 1.
  203. 1 => __( 'Category added.' ),
  204. 2 => __( 'Category deleted.' ),
  205. 3 => __( 'Category updated.' ),
  206. 4 => __( 'Category not added.' ),
  207. 5 => __( 'Category not updated.' ),
  208. 6 => __( 'Categories deleted.' )
  209. );
  210. $messages['post_tag'] = array(
  211. 0 => '', // Unused. Messages start at index 1.
  212. 1 => __( 'Tag added.' ),
  213. 2 => __( 'Tag deleted.' ),
  214. 3 => __( 'Tag updated.' ),
  215. 4 => __( 'Tag not added.' ),
  216. 5 => __( 'Tag not updated.' ),
  217. 6 => __( 'Tags deleted.' )
  218. );
  219. /**
  220. * Filter the messages displayed when a tag is updated.
  221. *
  222. * @since 3.7.0
  223. *
  224. * @param array $messages The messages to be displayed.
  225. */
  226. $messages = apply_filters( 'term_updated_messages', $messages );
  227. $message = false;
  228. if ( isset( $_REQUEST['message'] ) && ( $msg = (int) $_REQUEST['message'] ) ) {
  229. if ( isset( $messages[ $taxonomy ][ $msg ] ) )
  230. $message = $messages[ $taxonomy ][ $msg ];
  231. elseif ( ! isset( $messages[ $taxonomy ] ) && isset( $messages['_item'][ $msg ] ) )
  232. $message = $messages['_item'][ $msg ];
  233. }
  234. ?>
  235. <div class="wrap nosubsub">
  236. <h2><?php echo esc_html( $title );
  237. if ( !empty($_REQUEST['s']) )
  238. printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( wp_unslash($_REQUEST['s']) ) ); ?>
  239. </h2>
  240. <?php if ( $message ) : ?>
  241. <div id="message" class="updated"><p><?php echo $message; ?></p></div>
  242. <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
  243. endif; ?>
  244. <div id="ajax-response"></div>
  245. <form class="search-form" action="" method="get">
  246. <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
  247. <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
  248. <?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>
  249. </form>
  250. <br class="clear" />
  251. <div id="col-container">
  252. <div id="col-right">
  253. <div class="col-wrap">
  254. <form id="posts-filter" action="" method="post">
  255. <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
  256. <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
  257. <?php $wp_list_table->display(); ?>
  258. <br class="clear" />
  259. </form>
  260. <?php if ( 'category' == $taxonomy ) : ?>
  261. <div class="form-wrap">
  262. <?php /** This filter is documented in wp-includes/category-template.php */ ?>
  263. <p><?php 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')))) ?></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, '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' );