Нет описания

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

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