[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/includes/ -> class-wp-terms-list-table.php (source)

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


Generated : Wed Apr 15 08:20:10 2026 Cross-referenced by PHPXref