/wp-admin/edit-tags.php

  1. <?php 
  2. /** 
  3. * Edit Tags Administration Screen. 
  4. * 
  5. * @package WordPress 
  6. * @subpackage Administration 
  7. */ 
  8.  
  9. /** WordPress Administration Bootstrap */ 
  10. require_once( dirname( __FILE__ ) . '/admin.php' ); 
  11.  
  12. if ( ! $taxnow ) 
  13. wp_die( __( 'Invalid taxonomy.' ) ); 
  14.  
  15. $tax = get_taxonomy( $taxnow ); 
  16.  
  17. if ( ! $tax ) 
  18. wp_die( __( 'Invalid taxonomy.' ) ); 
  19.  
  20. if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) { 
  21. wp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) ); 
  22.  
  23. if ( ! current_user_can( $tax->cap->manage_terms ) ) { 
  24. wp_die( 
  25. '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 
  26. '<p>' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '</p>',  
  27. 403 
  28. ); 
  29.  
  30. /** 
  31. * $post_type is set when the WP_Terms_List_Table instance is created 
  32. * 
  33. * @global string $post_type 
  34. */ 
  35. global $post_type; 
  36.  
  37. $wp_list_table = _get_list_table('WP_Terms_List_Table'); 
  38. $pagenum = $wp_list_table->get_pagenum(); 
  39.  
  40. $title = $tax->labels->name; 
  41.  
  42. if ( 'post' != $post_type ) { 
  43. $parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type"; 
  44. $submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type"; 
  45. } elseif ( 'link_category' == $tax->name ) { 
  46. $parent_file = 'link-manager.php'; 
  47. $submenu_file = 'edit-tags.php?taxonomy=link_category'; 
  48. } else { 
  49. $parent_file = 'edit.php'; 
  50. $submenu_file = "edit-tags.php?taxonomy=$taxonomy"; 
  51.  
  52. add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) ); 
  53.  
  54. get_current_screen()->set_screen_reader_content( array( 
  55. 'heading_pagination' => $tax->labels->items_list_navigation,  
  56. 'heading_list' => $tax->labels->items_list,  
  57. ) ); 
  58.  
  59. $location = false; 
  60. $referer = wp_get_referer(); 
  61. if ( ! $referer ) { // For POST requests. 
  62. $referer = wp_unslash( $_SERVER['REQUEST_URI'] ); 
  63. $referer = remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'error', 'message', 'paged' ), $referer ); 
  64.  
  65. switch ( $wp_list_table->current_action() ) { 
  66.  
  67. case 'add-tag': 
  68. check_admin_referer( 'add-tag', '_wpnonce_add-tag' ); 
  69.  
  70. if ( ! current_user_can( $tax->cap->edit_terms ) ) { 
  71. wp_die( 
  72. '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 
  73. '<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>',  
  74. 403 
  75. ); 
  76.  
  77. $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST ); 
  78. if ( $ret && !is_wp_error( $ret ) ) 
  79. $location = add_query_arg( 'message', 1, $referer ); 
  80. else 
  81. $location = add_query_arg( array( 'error' => true, 'message' => 4 ), $referer ); 
  82.  
  83. break; 
  84.  
  85. case 'delete': 
  86. if ( ! isset( $_REQUEST['tag_ID'] ) ) { 
  87. break; 
  88.  
  89. $tag_ID = (int) $_REQUEST['tag_ID']; 
  90. check_admin_referer( 'delete-tag_' . $tag_ID ); 
  91.  
  92. if ( ! current_user_can( 'delete_term', $tag_ID ) ) { 
  93. wp_die( 
  94. '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 
  95. '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',  
  96. 403 
  97. ); 
  98.  
  99. wp_delete_term( $tag_ID, $taxonomy ); 
  100.  
  101. $location = add_query_arg( 'message', 2, $referer ); 
  102.  
  103. break; 
  104.  
  105. case 'bulk-delete': 
  106. check_admin_referer( 'bulk-tags' ); 
  107.  
  108. if ( ! current_user_can( $tax->cap->delete_terms ) ) { 
  109. wp_die( 
  110. '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 
  111. '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',  
  112. 403 
  113. ); 
  114.  
  115. $tags = (array) $_REQUEST['delete_tags']; 
  116. foreach ( $tags as $tag_ID ) { 
  117. wp_delete_term( $tag_ID, $taxonomy ); 
  118.  
  119. $location = add_query_arg( 'message', 6, $referer ); 
  120.  
  121. break; 
  122.  
  123. case 'edit': 
  124. if ( ! isset( $_REQUEST['tag_ID'] ) ) { 
  125. break; 
  126.  
  127. $term_id = (int) $_REQUEST['tag_ID']; 
  128. $term = get_term( $term_id ); 
  129.  
  130. if ( ! $term instanceof WP_Term ) { 
  131. wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) ); 
  132.  
  133. wp_redirect( esc_url_raw( get_edit_term_link( $term_id, $taxonomy, $post_type ) ) ); 
  134. exit; 
  135.  
  136. case 'editedtag': 
  137. $tag_ID = (int) $_POST['tag_ID']; 
  138. check_admin_referer( 'update-tag_' . $tag_ID ); 
  139.  
  140. if ( ! current_user_can( 'edit_term', $tag_ID ) ) { 
  141. wp_die( 
  142. '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 
  143. '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',  
  144. 403 
  145. ); 
  146.  
  147. $tag = get_term( $tag_ID, $taxonomy ); 
  148. if ( ! $tag ) 
  149. wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) ); 
  150.  
  151. $ret = wp_update_term( $tag_ID, $taxonomy, $_POST ); 
  152.  
  153. if ( $ret && ! is_wp_error( $ret ) ) { 
  154. $location = add_query_arg( 'message', 3, $referer ); 
  155. } else { 
  156. $location = add_query_arg( array( 'error' => true, 'message' => 5 ), $referer ); 
  157. break; 
  158. default: 
  159. if ( ! $wp_list_table->current_action() || ! isset( $_REQUEST['delete_tags'] ) ) { 
  160. break; 
  161. check_admin_referer( 'bulk-tags' ); 
  162. $tags = (array) $_REQUEST['delete_tags']; 
  163. /** This action is documented in wp-admin/edit-comments.php */ 
  164. $location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $wp_list_table->current_action(), $tags ); 
  165. break; 
  166.  
  167. if ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) { 
  168. $location = remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ); 
  169.  
  170. if ( $location ) { 
  171. if ( $pagenum > 1 ) { 
  172. $location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages. 
  173.  
  174. /** 
  175. * Filters the taxonomy redirect destination URL. 
  176. * 
  177. * @since 4.6.0 
  178. * 
  179. * @param string $location The destination URL. 
  180. * @param object $tax The taxonomy object. 
  181. */ 
  182. wp_redirect( apply_filters( 'redirect_term_location', $location, $tax ) ); 
  183. exit; 
  184.  
  185. $wp_list_table->prepare_items(); 
  186. $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 
  187.  
  188. if ( $pagenum > $total_pages && $total_pages > 0 ) { 
  189. wp_redirect( add_query_arg( 'paged', $total_pages ) ); 
  190. exit; 
  191.  
  192. wp_enqueue_script('admin-tags'); 
  193. if ( current_user_can($tax->cap->edit_terms) ) 
  194. wp_enqueue_script('inline-edit-tax'); 
  195.  
  196. if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy ) { 
  197. $help =''; 
  198. if ( 'category' == $taxonomy ) 
  199. $help = '<p>' . sprintf(__( 'You can use categories to define sections of your site and group related posts. The default category is “Uncategorized” until you change it in your <a href="%s">writing settings</a>.' ) , 'options-writing.php' ) . '</p>'; 
  200. elseif ( 'link_category' == $taxonomy ) 
  201. $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>'; 
  202. else 
  203. $help = '<p>' . __( 'You can assign keywords to your posts using <strong>tags</strong>. Unlike categories, tags have no hierarchy, meaning there’s no relationship from one tag to another.' ) . '</p>'; 
  204.  
  205. if ( 'link_category' == $taxonomy ) 
  206. $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>'; 
  207. else 
  208. $help .='<p>' . __( 'What’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>'; 
  209.  
  210. get_current_screen()->add_help_tab( array( 
  211. 'id' => 'overview',  
  212. 'title' => __('Overview'),  
  213. 'content' => $help,  
  214. ) ); 
  215.  
  216. if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) { 
  217. if ( 'category' == $taxonomy ) 
  218. $help = '<p>' . __( 'When adding a new category on this screen, you’ll fill in the following fields:' ) . '</p>'; 
  219. else 
  220. $help = '<p>' . __( 'When adding a new tag on this screen, you’ll fill in the following fields:' ) . '</p>'; 
  221.  
  222. $help .= '<ul>' . 
  223. '<li>' . __( '<strong>Name</strong> — The name is how it appears on your site.' ) . '</li>'; 
  224.  
  225. if ( ! global_terms_enabled() ) 
  226. $help .= '<li>' . __( '<strong>Slug</strong> — The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>'; 
  227.  
  228. if ( 'category' == $taxonomy ) 
  229. $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>'; 
  230.  
  231. $help .= '<li>' . __( '<strong>Description</strong> — The description is not prominent by default; however, some themes may display it.' ) . '</li>' . 
  232. '</ul>' . 
  233. '<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>'; 
  234.  
  235. get_current_screen()->add_help_tab( array( 
  236. 'id' => 'adding-terms',  
  237. 'title' => 'category' == $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),  
  238. 'content' => $help,  
  239. ) ); 
  240.  
  241. $help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>'; 
  242.  
  243. if ( 'category' == $taxonomy ) 
  244. $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Categories_Screen">Documentation on Categories</a>' ) . '</p>'; 
  245. elseif ( 'link_category' == $taxonomy ) 
  246. $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Links_Link_Categories_Screen">Documentation on Link Categories</a>' ) . '</p>'; 
  247. else 
  248. $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Tags_Screen">Documentation on Tags</a>' ) . '</p>'; 
  249.  
  250. $help .= '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'; 
  251.  
  252. get_current_screen()->set_help_sidebar( $help ); 
  253.  
  254. unset( $help ); 
  255.  
  256. require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
  257.  
  258. /** Also used by the Edit Tag form */ 
  259. require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' ); 
  260.  
  261. $class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated'; 
  262.  
  263. if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) { 
  264. $import_link = admin_url( 'admin.php?import=wpcat2tag' ); 
  265. } else { 
  266. $import_link = admin_url( 'import.php' ); 
  267.  
  268. ?> 
  269.  
  270. <div class="wrap nosubsub"> 
  271. <h1><?php echo esc_html( $title ); 
  272. if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { 
  273. /** translators: %s: search keywords */ 
  274. printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) ); 
  275. ?> 
  276. </h1> 
  277.  
  278. <?php if ( $message ) : ?> 
  279. <div id="message" class="<?php echo $class; ?> notice is-dismissible"><p><?php echo $message; ?></p></div> 
  280. <?php $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] ); 
  281. endif; ?> 
  282. <div id="ajax-response"></div> 
  283.  
  284. <form class="search-form wp-clearfix" method="get"> 
  285. <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> 
  286. <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" /> 
  287.  
  288. <?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?> 
  289.  
  290. </form> 
  291.  
  292. <div id="col-container" class="wp-clearfix"> 
  293.  
  294. <div id="col-left"> 
  295. <div class="col-wrap"> 
  296.  
  297. <?php 
  298.  
  299. if ( current_user_can($tax->cap->edit_terms) ) { 
  300. if ( 'category' == $taxonomy ) { 
  301. /** 
  302. * Fires before the Add Category form. 
  303. * 
  304. * @since 2.1.0 
  305. * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead. 
  306. * 
  307. * @param object $arg Optional arguments cast to an object. 
  308. */ 
  309. do_action( 'add_category_form_pre', (object) array( 'parent' => 0 ) ); 
  310. } elseif ( 'link_category' == $taxonomy ) { 
  311. /** 
  312. * Fires before the link category form. 
  313. * 
  314. * @since 2.3.0 
  315. * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead. 
  316. * 
  317. * @param object $arg Optional arguments cast to an object. 
  318. */ 
  319. do_action( 'add_link_category_form_pre', (object) array( 'parent' => 0 ) ); 
  320. } else { 
  321. /** 
  322. * Fires before the Add Tag form. 
  323. * 
  324. * @since 2.5.0 
  325. * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead. 
  326. * 
  327. * @param string $taxonomy The taxonomy slug. 
  328. */ 
  329. do_action( 'add_tag_form_pre', $taxonomy ); 
  330.  
  331. /** 
  332. * Fires before the Add Term form for all taxonomies. 
  333. * 
  334. * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. 
  335. * 
  336. * @since 3.0.0 
  337. * 
  338. * @param string $taxonomy The taxonomy slug. 
  339. */ 
  340. do_action( "{$taxonomy}_pre_add_form", $taxonomy ); 
  341. ?> 
  342.  
  343. <div class="form-wrap"> 
  344. <h2><?php echo $tax->labels->add_new_item; ?></h2> 
  345. <form id="addtag" method="post" action="edit-tags.php" class="validate"<?php 
  346. /** 
  347. * Fires inside the Add Tag form tag. 
  348. * 
  349. * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. 
  350. * 
  351. * @since 3.7.0 
  352. */ 
  353. do_action( "{$taxonomy}_term_new_form_tag" ); 
  354. ?>> 
  355. <input type="hidden" name="action" value="add-tag" /> 
  356. <input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" /> 
  357. <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> 
  358. <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" /> 
  359. <?php wp_nonce_field('add-tag', '_wpnonce_add-tag'); ?> 
  360.  
  361. <div class="form-field form-required term-name-wrap"> 
  362. <label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label> 
  363. <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" /> 
  364. <p><?php _e('The name is how it appears on your site.'); ?></p> 
  365. </div> 
  366. <?php if ( ! global_terms_enabled() ) : ?> 
  367. <div class="form-field term-slug-wrap"> 
  368. <label for="tag-slug"><?php _e( 'Slug' ); ?></label> 
  369. <input name="slug" id="tag-slug" type="text" value="" size="40" /> 
  370. <p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p> 
  371. </div> 
  372. <?php endif; // global_terms_enabled() ?> 
  373. <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?> 
  374. <div class="form-field term-parent-wrap"> 
  375. <label for="parent"><?php _ex( 'Parent', 'term parent' ); ?></label> 
  376. <?php 
  377. $dropdown_args = array( 
  378. 'hide_empty' => 0,  
  379. 'hide_if_empty' => false,  
  380. 'taxonomy' => $taxonomy,  
  381. 'name' => 'parent',  
  382. 'orderby' => 'name',  
  383. 'hierarchical' => true,  
  384. 'show_option_none' => __( 'None' ),  
  385. ); 
  386.  
  387. /** 
  388. * Filters the taxonomy parent drop-down on the Edit Term page. 
  389. * 
  390. * @since 3.7.0 
  391. * @since 4.2.0 Added `$context` parameter. 
  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. * @param string $context Filter context. Accepts 'new' or 'edit'. 
  407. */ 
  408. $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' ); 
  409.  
  410. wp_dropdown_categories( $dropdown_args ); 
  411. ?> 
  412. <?php if ( 'category' == $taxonomy ) : // @todo: Generic text for hierarchical taxonomies ?> 
  413. <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> 
  414. <?php endif; ?> 
  415. </div> 
  416. <?php endif; // is_taxonomy_hierarchical() ?> 
  417. <div class="form-field term-description-wrap"> 
  418. <label for="tag-description"><?php _e( 'Description' ); ?></label> 
  419. <textarea name="description" id="tag-description" rows="5" cols="40"></textarea> 
  420. <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p> 
  421. </div> 
  422.  
  423. <?php 
  424. if ( ! is_taxonomy_hierarchical( $taxonomy ) ) { 
  425. /** 
  426. * Fires after the Add Tag form fields for non-hierarchical taxonomies. 
  427. * 
  428. * @since 3.0.0 
  429. * 
  430. * @param string $taxonomy The taxonomy slug. 
  431. */ 
  432. do_action( 'add_tag_form_fields', $taxonomy ); 
  433.  
  434. /** 
  435. * Fires after the Add Term form fields. 
  436. * 
  437. * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. 
  438. * 
  439. * @since 3.0.0 
  440. * 
  441. * @param string $taxonomy The taxonomy slug. 
  442. */ 
  443. do_action( "{$taxonomy}_add_form_fields", $taxonomy ); 
  444.  
  445. submit_button( $tax->labels->add_new_item ); 
  446.  
  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.  
  492. </div> 
  493. </div><!-- /col-left --> 
  494.  
  495. <div id="col-right"> 
  496. <div class="col-wrap"> 
  497. <form id="posts-filter" method="post"> 
  498. <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>" /> 
  499. <input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" /> 
  500.  
  501. <?php $wp_list_table->display(); ?> 
  502.  
  503. </form> 
  504.  
  505. <?php if ( 'category' == $taxonomy ) : ?> 
  506. <div class="form-wrap edit-term-notes"> 
  507. <p> 
  508. <?php 
  509. echo '<strong>' . __( 'Note:' ) . '</strong><br />'; 
  510. printf( 
  511. /** translators: %s: default category */ 
  512. __( 'Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.' ),  
  513. /** This filter is documented in wp-includes/category-template.php */ 
  514. '<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) . '</strong>' 
  515. ); 
  516. ?> 
  517. </p> 
  518. <?php if ( current_user_can( 'import' ) ) : ?> 
  519. <p><?php printf( __( 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.' ), esc_url( $import_link ) ) ?></p> 
  520. <?php endif; ?> 
  521. </div> 
  522. <?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?> 
  523. <div class="form-wrap edit-term-notes"> 
  524. <p><?php printf( __( 'Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.' ), esc_url( $import_link ) ) ;?></p> 
  525. </div> 
  526. <?php endif; 
  527.  
  528. /** 
  529. * Fires after the taxonomy list table. 
  530. * 
  531. * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. 
  532. * 
  533. * @since 3.0.0 
  534. * 
  535. * @param string $taxonomy The taxonomy name. 
  536. */ 
  537. do_action( "after-{$taxonomy}-table", $taxonomy ); 
  538. ?> 
  539.  
  540. </div> 
  541. </div><!-- /col-right --> 
  542.  
  543. </div><!-- /col-container --> 
  544. </div><!-- /wrap --> 
  545.  
  546. <?php if ( ! wp_is_mobile() ) : ?> 
  547. <script type="text/javascript"> 
  548. try{document.forms.addtag['tag-name'].focus();}catch(e) {} 
  549. </script> 
  550. <?php 
  551. endif; 
  552.  
  553. $wp_list_table->inline_edit(); 
  554.  
  555. include( ABSPATH . 'wp-admin/admin-footer.php' ); 
.