Ei kuvausta

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

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