class-wp-terms-list-table.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. <?php
  2. /**
  3. * List Table API: WP_Terms_List_Table class
  4. *
  5. * @package WordPress
  6. * @subpackage Administration
  7. * @since 3.1.0
  8. */
  9. /**
  10. * Core class used to implement displaying terms in a list table.
  11. *
  12. * @since 3.1.0
  13. *
  14. * @see WP_List_Table
  15. */
  16. class WP_Terms_List_Table extends WP_List_Table {
  17. public $callback_args;
  18. private $level;
  19. /**
  20. * Constructor.
  21. *
  22. * @since 3.1.0
  23. *
  24. * @see WP_List_Table::__construct() for more information on default arguments.
  25. *
  26. * @global string $post_type
  27. * @global string $taxonomy
  28. * @global string $action
  29. * @global object $tax
  30. *
  31. * @param array $args An associative array of arguments.
  32. */
  33. public function __construct( $args = array() ) {
  34. global $post_type, $taxonomy, $action, $tax;
  35. parent::__construct(
  36. array(
  37. 'plural' => 'tags',
  38. 'singular' => 'tag',
  39. 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
  40. )
  41. );
  42. $action = $this->screen->action;
  43. $post_type = $this->screen->post_type;
  44. $taxonomy = $this->screen->taxonomy;
  45. if ( empty( $taxonomy ) ) {
  46. $taxonomy = 'post_tag';
  47. }
  48. if ( ! taxonomy_exists( $taxonomy ) ) {
  49. wp_die( __( 'Invalid taxonomy.' ) );
  50. }
  51. $tax = get_taxonomy( $taxonomy );
  52. // @todo Still needed? Maybe just the show_ui part.
  53. if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ), true ) ) {
  54. $post_type = 'post';
  55. }
  56. }
  57. /**
  58. * @return bool
  59. */
  60. public function ajax_user_can() {
  61. return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms );
  62. }
  63. /**
  64. */
  65. public function prepare_items() {
  66. $taxonomy = $this->screen->taxonomy;
  67. $tags_per_page = $this->get_items_per_page( "edit_{$taxonomy}_per_page" );
  68. if ( 'post_tag' === $taxonomy ) {
  69. /**
  70. * Filters the number of terms displayed per page for the Tags list table.
  71. *
  72. * @since 2.8.0
  73. *
  74. * @param int $tags_per_page Number of tags to be displayed. Default 20.
  75. */
  76. $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
  77. /**
  78. * Filters the number of terms displayed per page for the Tags list table.
  79. *
  80. * @since 2.7.0
  81. * @deprecated 2.8.0 Use {@see 'edit_tags_per_page'} instead.
  82. *
  83. * @param int $tags_per_page Number of tags to be displayed. Default 20.
  84. */
  85. $tags_per_page = apply_filters_deprecated( 'tagsperpage', array( $tags_per_page ), '2.8.0', 'edit_tags_per_page' );
  86. } elseif ( 'category' === $taxonomy ) {
  87. /**
  88. * Filters the number of terms displayed per page for the Categories list table.
  89. *
  90. * @since 2.8.0
  91. *
  92. * @param int $tags_per_page Number of categories to be displayed. Default 20.
  93. */
  94. $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page );
  95. }
  96. $search = ! empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';
  97. $args = array(
  98. 'taxonomy' => $taxonomy,
  99. 'search' => $search,
  100. 'page' => $this->get_pagenum(),
  101. 'number' => $tags_per_page,
  102. 'hide_empty' => 0,
  103. );
  104. if ( ! empty( $_REQUEST['orderby'] ) ) {
  105. $args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) );
  106. }
  107. if ( ! empty( $_REQUEST['order'] ) ) {
  108. $args['order'] = trim( wp_unslash( $_REQUEST['order'] ) );
  109. }
  110. $args['offset'] = ( $args['page'] - 1 ) * $args['number'];
  111. // Save the values because 'number' and 'offset' can be subsequently overridden.
  112. $this->callback_args = $args;
  113. if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
  114. // We'll need the full set of terms then.
  115. $args['number'] = 0;
  116. $args['offset'] = $args['number'];
  117. }
  118. $this->items = get_terms( $args );
  119. $this->set_pagination_args(
  120. array(
  121. 'total_items' => wp_count_terms(
  122. array(
  123. 'taxonomy' => $taxonomy,
  124. 'search' => $search,
  125. )
  126. ),
  127. 'per_page' => $tags_per_page,
  128. )
  129. );
  130. }
  131. /**
  132. */
  133. public function no_items() {
  134. echo get_taxonomy( $this->screen->taxonomy )->labels->not_found;
  135. }
  136. /**
  137. * @return array
  138. */
  139. protected function get_bulk_actions() {
  140. $actions = array();
  141. if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) ) {
  142. $actions['delete'] = __( 'Delete' );
  143. }
  144. return $actions;
  145. }
  146. /**
  147. * @return string
  148. */
  149. public function current_action() {
  150. if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && 'delete' === $_REQUEST['action'] ) {
  151. return 'bulk-delete';
  152. }
  153. return parent::current_action();
  154. }
  155. /**
  156. * @return array
  157. */
  158. public function get_columns() {
  159. $columns = array(
  160. 'cb' => '<input type="checkbox" />',
  161. 'name' => _x( 'Name', 'term name' ),
  162. 'description' => __( 'Description' ),
  163. 'slug' => __( 'Slug' ),
  164. );
  165. if ( 'link_category' === $this->screen->taxonomy ) {
  166. $columns['links'] = __( 'Links' );
  167. } else {
  168. $columns['posts'] = _x( 'Count', 'Number/count of items' );
  169. }
  170. return $columns;
  171. }
  172. /**
  173. * @return array
  174. */
  175. protected function get_sortable_columns() {
  176. return array(
  177. 'name' => 'name',
  178. 'description' => 'description',
  179. 'slug' => 'slug',
  180. 'posts' => 'count',
  181. 'links' => 'count',
  182. );
  183. }
  184. /**
  185. */
  186. public function display_rows_or_placeholder() {
  187. $taxonomy = $this->screen->taxonomy;
  188. $number = $this->callback_args['number'];
  189. $offset = $this->callback_args['offset'];
  190. // Convert it to table rows.
  191. $count = 0;
  192. if ( empty( $this->items ) || ! is_array( $this->items ) ) {
  193. echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
  194. $this->no_items();
  195. echo '</td></tr>';
  196. return;
  197. }
  198. if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $this->callback_args['orderby'] ) ) {
  199. if ( ! empty( $this->callback_args['search'] ) ) {// Ignore children on searches.
  200. $children = array();
  201. } else {
  202. $children = _get_term_hierarchy( $taxonomy );
  203. }
  204. /*
  205. * Some funky recursion to get the job done (paging & parents mainly) is contained within.
  206. * Skip it for non-hierarchical taxonomies for performance sake.
  207. */
  208. $this->_rows( $taxonomy, $this->items, $children, $offset, $number, $count );
  209. } else {
  210. foreach ( $this->items as $term ) {
  211. $this->single_row( $term );
  212. }
  213. }
  214. }
  215. /**
  216. * @param string $taxonomy
  217. * @param array $terms
  218. * @param array $children
  219. * @param int $start
  220. * @param int $per_page
  221. * @param int $count
  222. * @param int $parent_term
  223. * @param int $level
  224. */
  225. private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent_term = 0, $level = 0 ) {
  226. $end = $start + $per_page;
  227. foreach ( $terms as $key => $term ) {
  228. if ( $count >= $end ) {
  229. break;
  230. }
  231. if ( $term->parent !== $parent_term && empty( $_REQUEST['s'] ) ) {
  232. continue;
  233. }
  234. // If the page starts in a subtree, print the parents.
  235. if ( $count === $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) {
  236. $my_parents = array();
  237. $parent_ids = array();
  238. $p = $term->parent;
  239. while ( $p ) {
  240. $my_parent = get_term( $p, $taxonomy );
  241. $my_parents[] = $my_parent;
  242. $p = $my_parent->parent;
  243. if ( in_array( $p, $parent_ids, true ) ) { // Prevent parent loops.
  244. break;
  245. }
  246. $parent_ids[] = $p;
  247. }
  248. unset( $parent_ids );
  249. $num_parents = count( $my_parents );
  250. while ( $my_parent = array_pop( $my_parents ) ) {
  251. echo "\t";
  252. $this->single_row( $my_parent, $level - $num_parents );
  253. $num_parents--;
  254. }
  255. }
  256. if ( $count >= $start ) {
  257. echo "\t";
  258. $this->single_row( $term, $level );
  259. }
  260. ++$count;
  261. unset( $terms[ $key ] );
  262. if ( isset( $children[ $term->term_id ] ) && empty( $_REQUEST['s'] ) ) {
  263. $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
  264. }
  265. }
  266. }
  267. /**
  268. * @global string $taxonomy
  269. * @param WP_Term $tag Term object.
  270. * @param int $level
  271. */
  272. public function single_row( $tag, $level = 0 ) {
  273. global $taxonomy;
  274. $tag = sanitize_term( $tag, $taxonomy );
  275. $this->level = $level;
  276. if ( $tag->parent ) {
  277. $count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );
  278. $level = 'level-' . $count;
  279. } else {
  280. $level = 'level-0';
  281. }
  282. echo '<tr id="tag-' . $tag->term_id . '" class="' . $level . '">';
  283. $this->single_row_columns( $tag );
  284. echo '</tr>';
  285. }
  286. /**
  287. * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support.
  288. *
  289. * @param WP_Term $item Term object.
  290. * @return string
  291. */
  292. public function column_cb( $item ) {
  293. // Restores the more descriptive, specific name for use within this method.
  294. $tag = $item;
  295. if ( current_user_can( 'delete_term', $tag->term_id ) ) {
  296. return sprintf(
  297. '<label class="screen-reader-text" for="cb-select-%1$s">%2$s</label>' .
  298. '<input type="checkbox" name="delete_tags[]" value="%1$s" id="cb-select-%1$s" />',
  299. $tag->term_id,
  300. /* translators: %s: Taxonomy term name. */
  301. sprintf( __( 'Select %s' ), $tag->name )
  302. );
  303. }
  304. return '&nbsp;';
  305. }
  306. /**
  307. * @param WP_Term $tag Term object.
  308. * @return string
  309. */
  310. public function column_name( $tag ) {
  311. $taxonomy = $this->screen->taxonomy;
  312. $pad = str_repeat( '&#8212; ', max( 0, $this->level ) );
  313. /**
  314. * Filters display of the term name in the terms list table.
  315. *
  316. * The default output may include padding due to the term's
  317. * current level in the term hierarchy.
  318. *
  319. * @since 2.5.0
  320. *
  321. * @see WP_Terms_List_Table::column_name()
  322. *
  323. * @param string $pad_tag_name The term name, padded if not top-level.
  324. * @param WP_Term $tag Term object.
  325. */
  326. $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
  327. $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
  328. $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
  329. $edit_link = get_edit_term_link( $tag, $taxonomy, $this->screen->post_type );
  330. if ( $edit_link ) {
  331. $edit_link = add_query_arg(
  332. 'wp_http_referer',
  333. urlencode( wp_unslash( $uri ) ),
  334. $edit_link
  335. );
  336. $name = sprintf(
  337. '<a class="row-title" href="%s" aria-label="%s">%s</a>',
  338. esc_url( $edit_link ),
  339. /* translators: %s: Taxonomy term name. */
  340. esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $tag->name ) ),
  341. $name
  342. );
  343. }
  344. $output = sprintf(
  345. '<strong>%s</strong><br />',
  346. $name
  347. );
  348. $output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
  349. $output .= '<div class="name">' . $qe_data->name . '</div>';
  350. /** This filter is documented in wp-admin/edit-tag-form.php */
  351. $output .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>';
  352. $output .= '<div class="parent">' . $qe_data->parent . '</div></div>';
  353. return $output;
  354. }
  355. /**
  356. * Gets the name of the default primary column.
  357. *
  358. * @since 4.3.0
  359. *
  360. * @return string Name of the default primary column, in this case, 'name'.
  361. */
  362. protected function get_default_primary_column_name() {
  363. return 'name';
  364. }
  365. /**
  366. * Generates and displays row action links.
  367. *
  368. * @since 4.3.0
  369. * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support.
  370. *
  371. * @param WP_Term $item Tag being acted upon.
  372. * @param string $column_name Current column name.
  373. * @param string $primary Primary column name.
  374. * @return string Row actions output for terms, or an empty string
  375. * if the current column is not the primary column.
  376. */
  377. protected function handle_row_actions( $item, $column_name, $primary ) {
  378. if ( $primary !== $column_name ) {
  379. return '';
  380. }
  381. // Restores the more descriptive, specific name for use within this method.
  382. $tag = $item;
  383. $taxonomy = $this->screen->taxonomy;
  384. $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
  385. $edit_link = add_query_arg(
  386. 'wp_http_referer',
  387. urlencode( wp_unslash( $uri ) ),
  388. get_edit_term_link( $tag, $taxonomy, $this->screen->post_type )
  389. );
  390. $actions = array();
  391. if ( current_user_can( 'edit_term', $tag->term_id ) ) {
  392. $actions['edit'] = sprintf(
  393. '<a href="%s" aria-label="%s">%s</a>',
  394. esc_url( $edit_link ),
  395. /* translators: %s: Taxonomy term name. */
  396. esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $tag->name ) ),
  397. __( 'Edit' )
  398. );
  399. $actions['inline hide-if-no-js'] = sprintf(
  400. '<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
  401. /* translators: %s: Taxonomy term name. */
  402. esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $tag->name ) ),
  403. __( 'Quick&nbsp;Edit' )
  404. );
  405. }
  406. if ( current_user_can( 'delete_term', $tag->term_id ) ) {
  407. $actions['delete'] = sprintf(
  408. '<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>',
  409. wp_nonce_url( "edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ),
  410. /* translators: %s: Taxonomy term name. */
  411. esc_attr( sprintf( __( 'Delete &#8220;%s&#8221;' ), $tag->name ) ),
  412. __( 'Delete' )
  413. );
  414. }
  415. if ( is_term_publicly_viewable( $tag ) ) {
  416. $actions['view'] = sprintf(
  417. '<a href="%s" aria-label="%s">%s</a>',
  418. get_term_link( $tag ),
  419. /* translators: %s: Taxonomy term name. */
  420. esc_attr( sprintf( __( 'View &#8220;%s&#8221; archive' ), $tag->name ) ),
  421. __( 'View' )
  422. );
  423. }
  424. /**
  425. * Filters the action links displayed for each term in the Tags list table.
  426. *
  427. * @since 2.8.0
  428. * @since 3.0.0 Deprecated in favor of {@see '{$taxonomy}_row_actions'} filter.
  429. * @since 5.4.2 Restored (un-deprecated).
  430. *
  431. * @param string[] $actions An array of action links to be displayed. Default
  432. * 'Edit', 'Quick Edit', 'Delete', and 'View'.
  433. * @param WP_Term $tag Term object.
  434. */
  435. $actions = apply_filters( 'tag_row_actions', $actions, $tag );
  436. /**
  437. * Filters the action links displayed for each term in the terms list table.
  438. *
  439. * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
  440. *
  441. * Possible hook names include:
  442. *
  443. * - `category_row_actions`
  444. * - `post_tag_row_actions`
  445. *
  446. * @since 3.0.0
  447. *
  448. * @param string[] $actions An array of action links to be displayed. Default
  449. * 'Edit', 'Quick Edit', 'Delete', and 'View'.
  450. * @param WP_Term $tag Term object.
  451. */
  452. $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
  453. return $this->row_actions( $actions );
  454. }
  455. /**
  456. * @param WP_Term $tag Term object.
  457. * @return string
  458. */
  459. public function column_description( $tag ) {
  460. if ( $tag->description ) {
  461. return $tag->description;
  462. } else {
  463. return '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . __( 'No description' ) . '</span>';
  464. }
  465. }
  466. /**
  467. * @param WP_Term $tag Term object.
  468. * @return string
  469. */
  470. public function column_slug( $tag ) {
  471. /** This filter is documented in wp-admin/edit-tag-form.php */
  472. return apply_filters( 'editable_slug', $tag->slug, $tag );
  473. }
  474. /**
  475. * @param WP_Term $tag Term object.
  476. * @return string
  477. */
  478. public function column_posts( $tag ) {
  479. $count = number_format_i18n( $tag->count );
  480. $tax = get_taxonomy( $this->screen->taxonomy );
  481. $ptype_object = get_post_type_object( $this->screen->post_type );
  482. if ( ! $ptype_object->show_ui ) {
  483. return $count;
  484. }
  485. if ( $tax->query_var ) {
  486. $args = array( $tax->query_var => $tag->slug );
  487. } else {
  488. $args = array(
  489. 'taxonomy' => $tax->name,
  490. 'term' => $tag->slug,
  491. );
  492. }
  493. if ( 'post' !== $this->screen->post_type ) {
  494. $args['post_type'] = $this->screen->post_type;
  495. }
  496. if ( 'attachment' === $this->screen->post_type ) {
  497. return "<a href='" . esc_url( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>";
  498. }
  499. return "<a href='" . esc_url( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
  500. }
  501. /**
  502. * @param WP_Term $tag Term object.
  503. * @return string
  504. */
  505. public function column_links( $tag ) {
  506. $count = number_format_i18n( $tag->count );
  507. if ( $count ) {
  508. $count = "<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>";
  509. }
  510. return $count;
  511. }
  512. /**
  513. * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support.
  514. *
  515. * @param WP_Term $item Term object.
  516. * @param string $column_name Name of the column.
  517. * @return string
  518. */
  519. public function column_default( $item, $column_name ) {
  520. /**
  521. * Filters the displayed columns in the terms list table.
  522. *
  523. * The dynamic portion of the hook name, `$this->screen->taxonomy`,
  524. * refers to the slug of the current taxonomy.
  525. *
  526. * Possible hook names include:
  527. *
  528. * - `manage_category_custom_column`
  529. * - `manage_post_tag_custom_column`
  530. *
  531. * @since 2.8.0
  532. *
  533. * @param string $string Custom column output. Default empty.
  534. * @param string $column_name Name of the column.
  535. * @param int $term_id Term ID.
  536. */
  537. return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $item->term_id );
  538. }
  539. /**
  540. * Outputs the hidden row displayed when inline editing
  541. *
  542. * @since 3.1.0
  543. */
  544. public function inline_edit() {
  545. $tax = get_taxonomy( $this->screen->taxonomy );
  546. if ( ! current_user_can( $tax->cap->edit_terms ) ) {
  547. return;
  548. }
  549. ?>
  550. <form method="get">
  551. <table style="display: none"><tbody id="inlineedit">
  552. <tr id="inline-edit" class="inline-edit-row" style="display: none">
  553. <td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
  554. <div class="inline-edit-wrapper">
  555. <fieldset>
  556. <legend class="inline-edit-legend"><?php _e( 'Quick Edit' ); ?></legend>
  557. <div class="inline-edit-col">
  558. <label>
  559. <span class="title"><?php _ex( 'Name', 'term name' ); ?></span>
  560. <span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
  561. </label>
  562. <label>
  563. <span class="title"><?php _e( 'Slug' ); ?></span>
  564. <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
  565. </label>
  566. </div>
  567. </fieldset>
  568. <?php
  569. $core_columns = array(
  570. 'cb' => true,
  571. 'description' => true,
  572. 'name' => true,
  573. 'slug' => true,
  574. 'posts' => true,
  575. );
  576. list( $columns ) = $this->get_column_info();
  577. foreach ( $columns as $column_name => $column_display_name ) {
  578. if ( isset( $core_columns[ $column_name ] ) ) {
  579. continue;
  580. }
  581. /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
  582. do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
  583. }
  584. ?>
  585. <div class="inline-edit-save submit">
  586. <button type="button" class="save button button-primary"><?php echo $tax->labels->update_item; ?></button>
  587. <button type="button" class="cancel button"><?php _e( 'Cancel' ); ?></button>
  588. <span class="spinner"></span>
  589. <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
  590. <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" />
  591. <input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" />
  592. <div class="notice notice-error notice-alt inline hidden">
  593. <p class="error"></p>
  594. </div>
  595. </div>
  596. </div>
  597. </td></tr>
  598. </tbody></table>
  599. </form>
  600. <?php
  601. }
  602. }