[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * List Table API: WP_Posts_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 posts in a list table.
  12   *
  13   * @since 3.1.0
  14   * @access private
  15   *
  16   * @see WP_List_Table
  17   */
  18  class WP_Posts_List_Table extends WP_List_Table {
  19  
  20      /**
  21       * Whether the items should be displayed hierarchically or linearly.
  22       *
  23       * @since 3.1.0
  24       * @var bool
  25       */
  26      protected $hierarchical_display;
  27  
  28      /**
  29       * Holds the number of pending comments for each post.
  30       *
  31       * @since 3.1.0
  32       * @var array
  33       */
  34      protected $comment_pending_count;
  35  
  36      /**
  37       * Holds the number of posts for this user.
  38       *
  39       * @since 3.1.0
  40       * @var int
  41       */
  42      private $user_posts_count;
  43  
  44      /**
  45       * Holds the number of posts which are sticky.
  46       *
  47       * @since 3.1.0
  48       * @var int
  49       */
  50      private $sticky_posts_count = 0;
  51  
  52      private $is_trash;
  53  
  54      /**
  55       * Current level for output.
  56       *
  57       * @since 4.3.0
  58       * @var int
  59       */
  60      protected $current_level = 0;
  61  
  62      /**
  63       * Constructor.
  64       *
  65       * @since 3.1.0
  66       *
  67       * @see WP_List_Table::__construct() for more information on default arguments.
  68       *
  69       * @global WP_Post_Type $post_type_object
  70       * @global wpdb         $wpdb             WordPress database abstraction object.
  71       *
  72       * @param array $args An associative array of arguments.
  73       */
  74  	public function __construct( $args = array() ) {
  75          global $post_type_object, $wpdb;
  76  
  77          parent::__construct(
  78              array(
  79                  'plural' => 'posts',
  80                  'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
  81              )
  82          );
  83  
  84          $post_type        = $this->screen->post_type;
  85          $post_type_object = get_post_type_object( $post_type );
  86  
  87          $exclude_states         = get_post_stati(
  88              array(
  89                  'show_in_admin_all_list' => false,
  90              )
  91          );
  92          $this->user_posts_count = (int) $wpdb->get_var(
  93              $wpdb->prepare(
  94                  "
  95              SELECT COUNT( 1 )
  96              FROM $wpdb->posts
  97              WHERE post_type = %s
  98              AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' )
  99              AND post_author = %d
 100          ",
 101                  $post_type,
 102                  get_current_user_id()
 103              )
 104          );
 105  
 106          if ( $this->user_posts_count && ! current_user_can( $post_type_object->cap->edit_others_posts ) && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) ) {
 107              $_GET['author'] = get_current_user_id();
 108          }
 109  
 110          $sticky_posts = get_option( 'sticky_posts' );
 111          if ( 'post' === $post_type && $sticky_posts ) {
 112              $sticky_posts             = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
 113              $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ('trash', 'auto-draft') AND ID IN ($sticky_posts)", $post_type ) );
 114          }
 115      }
 116  
 117      /**
 118       * Sets whether the table layout should be hierarchical or not.
 119       *
 120       * @since 4.2.0
 121       *
 122       * @param bool $display Whether the table layout should be hierarchical.
 123       */
 124  	public function set_hierarchical_display( $display ) {
 125          $this->hierarchical_display = $display;
 126      }
 127  
 128      /**
 129       * @return bool
 130       */
 131  	public function ajax_user_can() {
 132          return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts );
 133      }
 134  
 135      /**
 136       * @global string   $mode             List table view mode.
 137       * @global array    $avail_post_stati
 138       * @global WP_Query $wp_query         WordPress Query object.
 139       * @global int      $per_page
 140       */
 141  	public function prepare_items() {
 142          global $mode, $avail_post_stati, $wp_query, $per_page;
 143  
 144          if ( ! empty( $_REQUEST['mode'] ) ) {
 145              $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
 146              set_user_setting( 'posts_list_mode', $mode );
 147          } else {
 148              $mode = get_user_setting( 'posts_list_mode', 'list' );
 149          }
 150  
 151          // Is going to call wp().
 152          $avail_post_stati = wp_edit_posts_query();
 153  
 154          $this->set_hierarchical_display( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' === $wp_query->query['orderby'] );
 155  
 156          $post_type = $this->screen->post_type;
 157          $per_page  = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
 158  
 159          /** This filter is documented in wp-admin/includes/post.php */
 160          $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
 161  
 162          if ( $this->hierarchical_display ) {
 163              $total_items = $wp_query->post_count;
 164          } elseif ( $wp_query->found_posts || $this->get_pagenum() === 1 ) {
 165              $total_items = $wp_query->found_posts;
 166          } else {
 167              $post_counts = (array) wp_count_posts( $post_type, 'readable' );
 168  
 169              if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati, true ) ) {
 170                  $total_items = $post_counts[ $_REQUEST['post_status'] ];
 171              } elseif ( isset( $_REQUEST['show_sticky'] ) && $_REQUEST['show_sticky'] ) {
 172                  $total_items = $this->sticky_posts_count;
 173              } elseif ( isset( $_GET['author'] ) && get_current_user_id() == $_GET['author'] ) {
 174                  $total_items = $this->user_posts_count;
 175              } else {
 176                  $total_items = array_sum( $post_counts );
 177  
 178                  // Subtract post types that are not included in the admin all list.
 179                  foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) {
 180                      $total_items -= $post_counts[ $state ];
 181                  }
 182              }
 183          }
 184  
 185          $this->is_trash = isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'];
 186  
 187          $this->set_pagination_args(
 188              array(
 189                  'total_items' => $total_items,
 190                  'per_page'    => $per_page,
 191              )
 192          );
 193      }
 194  
 195      /**
 196       * @return bool
 197       */
 198  	public function has_items() {
 199          return have_posts();
 200      }
 201  
 202      /**
 203       */
 204  	public function no_items() {
 205          if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) {
 206              echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash;
 207          } else {
 208              echo get_post_type_object( $this->screen->post_type )->labels->not_found;
 209          }
 210      }
 211  
 212      /**
 213       * Determine if the current view is the "All" view.
 214       *
 215       * @since 4.2.0
 216       *
 217       * @return bool Whether the current view is the "All" view.
 218       */
 219  	protected function is_base_request() {
 220          $vars = $_GET;
 221          unset( $vars['paged'] );
 222  
 223          if ( empty( $vars ) ) {
 224              return true;
 225          } elseif ( 1 === count( $vars ) && ! empty( $vars['post_type'] ) ) {
 226              return $this->screen->post_type === $vars['post_type'];
 227          }
 228  
 229          return 1 === count( $vars ) && ! empty( $vars['mode'] );
 230      }
 231  
 232      /**
 233       * Helper to create links to edit.php with params.
 234       *
 235       * @since 4.4.0
 236       *
 237       * @param string[] $args  Associative array of URL parameters for the link.
 238       * @param string   $label Link text.
 239       * @param string   $class Optional. Class attribute. Default empty string.
 240       * @return string The formatted link string.
 241       */
 242  	protected function get_edit_link( $args, $label, $class = '' ) {
 243          $url = add_query_arg( $args, 'edit.php' );
 244  
 245          $class_html   = '';
 246          $aria_current = '';
 247          if ( ! empty( $class ) ) {
 248              $class_html = sprintf(
 249                  ' class="%s"',
 250                  esc_attr( $class )
 251              );
 252  
 253              if ( 'current' === $class ) {
 254                  $aria_current = ' aria-current="page"';
 255              }
 256          }
 257  
 258          return sprintf(
 259              '<a href="%s"%s%s>%s</a>',
 260              esc_url( $url ),
 261              $class_html,
 262              $aria_current,
 263              $label
 264          );
 265      }
 266  
 267      /**
 268       * @global array $locked_post_status This seems to be deprecated.
 269       * @global array $avail_post_stati
 270       * @return array
 271       */
 272  	protected function get_views() {
 273          global $locked_post_status, $avail_post_stati;
 274  
 275          $post_type = $this->screen->post_type;
 276  
 277          if ( ! empty( $locked_post_status ) ) {
 278              return array();
 279          }
 280  
 281          $status_links = array();
 282          $num_posts    = wp_count_posts( $post_type, 'readable' );
 283          $total_posts  = array_sum( (array) $num_posts );
 284          $class        = '';
 285  
 286          $current_user_id = get_current_user_id();
 287          $all_args        = array( 'post_type' => $post_type );
 288          $mine            = '';
 289  
 290          // Subtract post types that are not included in the admin all list.
 291          foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) {
 292              $total_posts -= $num_posts->$state;
 293          }
 294  
 295          if ( $this->user_posts_count && $this->user_posts_count !== $total_posts ) {
 296              if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user_id ) ) {
 297                  $class = 'current';
 298              }
 299  
 300              $mine_args = array(
 301                  'post_type' => $post_type,
 302                  'author'    => $current_user_id,
 303              );
 304  
 305              $mine_inner_html = sprintf(
 306                  /* translators: %s: Number of posts. */
 307                  _nx(
 308                      'Mine <span class="count">(%s)</span>',
 309                      'Mine <span class="count">(%s)</span>',
 310                      $this->user_posts_count,
 311                      'posts'
 312                  ),
 313                  number_format_i18n( $this->user_posts_count )
 314              );
 315  
 316              $mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class );
 317  
 318              $all_args['all_posts'] = 1;
 319              $class                 = '';
 320          }
 321  
 322          if ( empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ) ) {
 323              $class = 'current';
 324          }
 325  
 326          $all_inner_html = sprintf(
 327              /* translators: %s: Number of posts. */
 328              _nx(
 329                  'All <span class="count">(%s)</span>',
 330                  'All <span class="count">(%s)</span>',
 331                  $total_posts,
 332                  'posts'
 333              ),
 334              number_format_i18n( $total_posts )
 335          );
 336  
 337          $status_links['all'] = $this->get_edit_link( $all_args, $all_inner_html, $class );
 338          if ( $mine ) {
 339              $status_links['mine'] = $mine;
 340          }
 341  
 342          foreach ( get_post_stati( array( 'show_in_admin_status_list' => true ), 'objects' ) as $status ) {
 343              $class = '';
 344  
 345              $status_name = $status->name;
 346  
 347              if ( ! in_array( $status_name, $avail_post_stati, true ) || empty( $num_posts->$status_name ) ) {
 348                  continue;
 349              }
 350  
 351              if ( isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'] ) {
 352                  $class = 'current';
 353              }
 354  
 355              $status_args = array(
 356                  'post_status' => $status_name,
 357                  'post_type'   => $post_type,
 358              );
 359  
 360              $status_label = sprintf(
 361                  translate_nooped_plural( $status->label_count, $num_posts->$status_name ),
 362                  number_format_i18n( $num_posts->$status_name )
 363              );
 364  
 365              $status_links[ $status_name ] = $this->get_edit_link( $status_args, $status_label, $class );
 366          }
 367  
 368          if ( ! empty( $this->sticky_posts_count ) ) {
 369              $class = ! empty( $_REQUEST['show_sticky'] ) ? 'current' : '';
 370  
 371              $sticky_args = array(
 372                  'post_type'   => $post_type,
 373                  'show_sticky' => 1,
 374              );
 375  
 376              $sticky_inner_html = sprintf(
 377                  /* translators: %s: Number of posts. */
 378                  _nx(
 379                      'Sticky <span class="count">(%s)</span>',
 380                      'Sticky <span class="count">(%s)</span>',
 381                      $this->sticky_posts_count,
 382                      'posts'
 383                  ),
 384                  number_format_i18n( $this->sticky_posts_count )
 385              );
 386  
 387              $sticky_link = array(
 388                  'sticky' => $this->get_edit_link( $sticky_args, $sticky_inner_html, $class ),
 389              );
 390  
 391              // Sticky comes after Publish, or if not listed, after All.
 392              $split        = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ), true );
 393              $status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );
 394          }
 395  
 396          return $status_links;
 397      }
 398  
 399      /**
 400       * @return array
 401       */
 402  	protected function get_bulk_actions() {
 403          $actions       = array();
 404          $post_type_obj = get_post_type_object( $this->screen->post_type );
 405  
 406          if ( current_user_can( $post_type_obj->cap->edit_posts ) ) {
 407              if ( $this->is_trash ) {
 408                  $actions['untrash'] = __( 'Restore' );
 409              } else {
 410                  $actions['edit'] = __( 'Edit' );
 411              }
 412          }
 413  
 414          if ( current_user_can( $post_type_obj->cap->delete_posts ) ) {
 415              if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {
 416                  $actions['delete'] = __( 'Delete permanently' );
 417              } else {
 418                  $actions['trash'] = __( 'Move to Trash' );
 419              }
 420          }
 421  
 422          return $actions;
 423      }
 424  
 425      /**
 426       * Displays a categories drop-down for filtering on the Posts list table.
 427       *
 428       * @since 4.6.0
 429       *
 430       * @global int $cat Currently selected category.
 431       *
 432       * @param string $post_type Post type slug.
 433       */
 434  	protected function categories_dropdown( $post_type ) {
 435          global $cat;
 436  
 437          /**
 438           * Filters whether to remove the 'Categories' drop-down from the post list table.
 439           *
 440           * @since 4.6.0
 441           *
 442           * @param bool   $disable   Whether to disable the categories drop-down. Default false.
 443           * @param string $post_type Post type slug.
 444           */
 445          if ( false !== apply_filters( 'disable_categories_dropdown', false, $post_type ) ) {
 446              return;
 447          }
 448  
 449          if ( is_object_in_taxonomy( $post_type, 'category' ) ) {
 450              $dropdown_options = array(
 451                  'show_option_all' => get_taxonomy( 'category' )->labels->all_items,
 452                  'hide_empty'      => 0,
 453                  'hierarchical'    => 1,
 454                  'show_count'      => 0,
 455                  'orderby'         => 'name',
 456                  'selected'        => $cat,
 457              );
 458  
 459              echo '<label class="screen-reader-text" for="cat">' . get_taxonomy( 'category' )->labels->filter_by_item . '</label>';
 460  
 461              wp_dropdown_categories( $dropdown_options );
 462          }
 463      }
 464  
 465      /**
 466       * Displays a formats drop-down for filtering items.
 467       *
 468       * @since 5.2.0
 469       * @access protected
 470       *
 471       * @param string $post_type Post type slug.
 472       */
 473  	protected function formats_dropdown( $post_type ) {
 474          /**
 475           * Filters whether to remove the 'Formats' drop-down from the post list table.
 476           *
 477           * @since 5.2.0
 478           * @since 5.5.0 The `$post_type` parameter was added.
 479           *
 480           * @param bool   $disable   Whether to disable the drop-down. Default false.
 481           * @param string $post_type Post type slug.
 482           */
 483          if ( apply_filters( 'disable_formats_dropdown', false, $post_type ) ) {
 484              return;
 485          }
 486  
 487          // Return if the post type doesn't have post formats or if we're in the Trash.
 488          if ( ! is_object_in_taxonomy( $post_type, 'post_format' ) || $this->is_trash ) {
 489              return;
 490          }
 491  
 492          // Make sure the dropdown shows only formats with a post count greater than 0.
 493          $used_post_formats = get_terms(
 494              array(
 495                  'taxonomy'   => 'post_format',
 496                  'hide_empty' => true,
 497              )
 498          );
 499  
 500          // Return if there are no posts using formats.
 501          if ( ! $used_post_formats ) {
 502              return;
 503          }
 504  
 505          $displayed_post_format = isset( $_GET['post_format'] ) ? $_GET['post_format'] : '';
 506          ?>
 507          <label for="filter-by-format" class="screen-reader-text"><?php _e( 'Filter by post format' ); ?></label>
 508          <select name="post_format" id="filter-by-format">
 509              <option<?php selected( $displayed_post_format, '' ); ?> value=""><?php _e( 'All formats' ); ?></option>
 510              <?php
 511              foreach ( $used_post_formats as $used_post_format ) {
 512                  // Post format slug.
 513                  $slug = str_replace( 'post-format-', '', $used_post_format->slug );
 514                  // Pretty, translated version of the post format slug.
 515                  $pretty_name = get_post_format_string( $slug );
 516                  // Skip the standard post format.
 517                  if ( 'standard' === $slug ) {
 518                      continue;
 519                  }
 520                  ?>
 521                  <option<?php selected( $displayed_post_format, $slug ); ?> value="<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $pretty_name ); ?></option>
 522                  <?php
 523              }
 524              ?>
 525          </select>
 526          <?php
 527      }
 528  
 529      /**
 530       * @param string $which
 531       */
 532  	protected function extra_tablenav( $which ) {
 533          ?>
 534          <div class="alignleft actions">
 535          <?php
 536          if ( 'top' === $which ) {
 537              ob_start();
 538  
 539              $this->months_dropdown( $this->screen->post_type );
 540              $this->categories_dropdown( $this->screen->post_type );
 541              $this->formats_dropdown( $this->screen->post_type );
 542  
 543              /**
 544               * Fires before the Filter button on the Posts and Pages list tables.
 545               *
 546               * The Filter button allows sorting by date and/or category on the
 547               * Posts list table, and sorting by date on the Pages list table.
 548               *
 549               * @since 2.1.0
 550               * @since 4.4.0 The `$post_type` parameter was added.
 551               * @since 4.6.0 The `$which` parameter was added.
 552               *
 553               * @param string $post_type The post type slug.
 554               * @param string $which     The location of the extra table nav markup:
 555               *                          'top' or 'bottom' for WP_Posts_List_Table,
 556               *                          'bar' for WP_Media_List_Table.
 557               */
 558              do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
 559  
 560              $output = ob_get_clean();
 561  
 562              if ( ! empty( $output ) ) {
 563                  echo $output;
 564                  submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
 565              }
 566          }
 567  
 568          if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) && $this->has_items() ) {
 569              submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
 570          }
 571          ?>
 572          </div>
 573          <?php
 574          /**
 575           * Fires immediately following the closing "actions" div in the tablenav for the posts
 576           * list table.
 577           *
 578           * @since 4.4.0
 579           *
 580           * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
 581           */
 582          do_action( 'manage_posts_extra_tablenav', $which );
 583      }
 584  
 585      /**
 586       * @return string
 587       */
 588  	public function current_action() {
 589          if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
 590              return 'delete_all';
 591          }
 592  
 593          return parent::current_action();
 594      }
 595  
 596      /**
 597       * @global string $mode List table view mode.
 598       *
 599       * @return array
 600       */
 601  	protected function get_table_classes() {
 602          global $mode;
 603  
 604          $mode_class = esc_attr( 'table-view-' . $mode );
 605  
 606          return array( 'widefat', 'fixed', 'striped', $mode_class, is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' );
 607      }
 608  
 609      /**
 610       * @return array
 611       */
 612  	public function get_columns() {
 613          $post_type = $this->screen->post_type;
 614  
 615          $posts_columns = array();
 616  
 617          $posts_columns['cb'] = '<input type="checkbox" />';
 618  
 619          /* translators: Posts screen column name. */
 620          $posts_columns['title'] = _x( 'Title', 'column name' );
 621  
 622          if ( post_type_supports( $post_type, 'author' ) ) {
 623              $posts_columns['author'] = __( 'Author' );
 624          }
 625  
 626          $taxonomies = get_object_taxonomies( $post_type, 'objects' );
 627          $taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' );
 628  
 629          /**
 630           * Filters the taxonomy columns in the Posts list table.
 631           *
 632           * The dynamic portion of the hook name, `$post_type`, refers to the post
 633           * type slug.
 634           *
 635           * Possible hook names include:
 636           *
 637           *  - `manage_taxonomies_for_post_columns`
 638           *  - `manage_taxonomies_for_page_columns`
 639           *
 640           * @since 3.5.0
 641           *
 642           * @param string[] $taxonomies Array of taxonomy names to show columns for.
 643           * @param string   $post_type  The post type.
 644           */
 645          $taxonomies = apply_filters( "manage_taxonomies_for_{$post_type}_columns", $taxonomies, $post_type );
 646          $taxonomies = array_filter( $taxonomies, 'taxonomy_exists' );
 647  
 648          foreach ( $taxonomies as $taxonomy ) {
 649              if ( 'category' === $taxonomy ) {
 650                  $column_key = 'categories';
 651              } elseif ( 'post_tag' === $taxonomy ) {
 652                  $column_key = 'tags';
 653              } else {
 654                  $column_key = 'taxonomy-' . $taxonomy;
 655              }
 656  
 657              $posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name;
 658          }
 659  
 660          $post_status = ! empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';
 661          if ( post_type_supports( $post_type, 'comments' ) && ! in_array( $post_status, array( 'pending', 'draft', 'future' ), true ) ) {
 662              $posts_columns['comments'] = '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Comments' ) . '"><span class="screen-reader-text">' . __( 'Comments' ) . '</span></span>';
 663          }
 664  
 665          $posts_columns['date'] = __( 'Date' );
 666  
 667          if ( 'page' === $post_type ) {
 668  
 669              /**
 670               * Filters the columns displayed in the Pages list table.
 671               *
 672               * @since 2.5.0
 673               *
 674               * @param string[] $post_columns An associative array of column headings.
 675               */
 676              $posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );
 677          } else {
 678  
 679              /**
 680               * Filters the columns displayed in the Posts list table.
 681               *
 682               * @since 1.5.0
 683               *
 684               * @param string[] $post_columns An associative array of column headings.
 685               * @param string   $post_type    The post type slug.
 686               */
 687              $posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );
 688          }
 689  
 690          /**
 691           * Filters the columns displayed in the Posts list table for a specific post type.
 692           *
 693           * The dynamic portion of the hook name, `$post_type`, refers to the post type slug.
 694           *
 695           * Possible hook names include:
 696           *
 697           *  - `manage_post_posts_columns`
 698           *  - `manage_page_posts_columns`
 699           *
 700           * @since 3.0.0
 701           *
 702           * @param string[] $post_columns An associative array of column headings.
 703           */
 704          return apply_filters( "manage_{$post_type}_posts_columns", $posts_columns );
 705      }
 706  
 707      /**
 708       * @return array
 709       */
 710  	protected function get_sortable_columns() {
 711          return array(
 712              'title'    => 'title',
 713              'parent'   => 'parent',
 714              'comments' => 'comment_count',
 715              'date'     => array( 'date', true ),
 716          );
 717      }
 718  
 719      /**
 720       * @global WP_Query $wp_query WordPress Query object.
 721       * @global int $per_page
 722       * @param array $posts
 723       * @param int   $level
 724       */
 725  	public function display_rows( $posts = array(), $level = 0 ) {
 726          global $wp_query, $per_page;
 727  
 728          if ( empty( $posts ) ) {
 729              $posts = $wp_query->posts;
 730          }
 731  
 732          add_filter( 'the_title', 'esc_html' );
 733  
 734          if ( $this->hierarchical_display ) {
 735              $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page );
 736          } else {
 737              $this->_display_rows( $posts, $level );
 738          }
 739      }
 740  
 741      /**
 742       * @param array $posts
 743       * @param int   $level
 744       */
 745  	private function _display_rows( $posts, $level = 0 ) {
 746          $post_type = $this->screen->post_type;
 747  
 748          // Create array of post IDs.
 749          $post_ids = array();
 750  
 751          foreach ( $posts as $a_post ) {
 752              $post_ids[] = $a_post->ID;
 753          }
 754  
 755          if ( post_type_supports( $post_type, 'comments' ) ) {
 756              $this->comment_pending_count = get_pending_comments_num( $post_ids );
 757          }
 758  
 759          foreach ( $posts as $post ) {
 760              $this->single_row( $post, $level );
 761          }
 762      }
 763  
 764      /**
 765       * @global wpdb    $wpdb WordPress database abstraction object.
 766       * @global WP_Post $post Global post object.
 767       * @param array $pages
 768       * @param int   $pagenum
 769       * @param int   $per_page
 770       */
 771  	private function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {
 772          global $wpdb;
 773  
 774          $level = 0;
 775  
 776          if ( ! $pages ) {
 777              $pages = get_pages( array( 'sort_column' => 'menu_order' ) );
 778  
 779              if ( ! $pages ) {
 780                  return;
 781              }
 782          }
 783  
 784          /*
 785           * Arrange pages into two parts: top level pages and children_pages
 786           * children_pages is two dimensional array, eg.
 787           * children_pages[10][] contains all sub-pages whose parent is 10.
 788           * It only takes O( N ) to arrange this and it takes O( 1 ) for subsequent lookup operations
 789           * If searching, ignore hierarchy and treat everything as top level
 790           */
 791          if ( empty( $_REQUEST['s'] ) ) {
 792  
 793              $top_level_pages = array();
 794              $children_pages  = array();
 795  
 796              foreach ( $pages as $page ) {
 797  
 798                  // Catch and repair bad pages.
 799                  if ( $page->post_parent == $page->ID ) {
 800                      $page->post_parent = 0;
 801                      $wpdb->update( $wpdb->posts, array( 'post_parent' => 0 ), array( 'ID' => $page->ID ) );
 802                      clean_post_cache( $page );
 803                  }
 804  
 805                  if ( 0 == $page->post_parent ) {
 806                      $top_level_pages[] = $page;
 807                  } else {
 808                      $children_pages[ $page->post_parent ][] = $page;
 809                  }
 810              }
 811  
 812              $pages = &$top_level_pages;
 813          }
 814  
 815          $count      = 0;
 816          $start      = ( $pagenum - 1 ) * $per_page;
 817          $end        = $start + $per_page;
 818          $to_display = array();
 819  
 820          foreach ( $pages as $page ) {
 821              if ( $count >= $end ) {
 822                  break;
 823              }
 824  
 825              if ( $count >= $start ) {
 826                  $to_display[ $page->ID ] = $level;
 827              }
 828  
 829              $count++;
 830  
 831              if ( isset( $children_pages ) ) {
 832                  $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display );
 833              }
 834          }
 835  
 836          // If it is the last pagenum and there are orphaned pages, display them with paging as well.
 837          if ( isset( $children_pages ) && $count < $end ) {
 838              foreach ( $children_pages as $orphans ) {
 839                  foreach ( $orphans as $op ) {
 840                      if ( $count >= $end ) {
 841                          break;
 842                      }
 843  
 844                      if ( $count >= $start ) {
 845                          $to_display[ $op->ID ] = 0;
 846                      }
 847  
 848                      $count++;
 849                  }
 850              }
 851          }
 852  
 853          $ids = array_keys( $to_display );
 854          _prime_post_caches( $ids );
 855  
 856          if ( ! isset( $GLOBALS['post'] ) ) {
 857              $GLOBALS['post'] = reset( $ids );
 858          }
 859  
 860          foreach ( $to_display as $page_id => $level ) {
 861              echo "\t";
 862              $this->single_row( $page_id, $level );
 863          }
 864      }
 865  
 866      /**
 867       * Given a top level page ID, display the nested hierarchy of sub-pages
 868       * together with paging support
 869       *
 870       * @since 3.1.0 (Standalone function exists since 2.6.0)
 871       * @since 4.2.0 Added the `$to_display` parameter.
 872       *
 873       * @param array $children_pages
 874       * @param int   $count
 875       * @param int   $parent
 876       * @param int   $level
 877       * @param int   $pagenum
 878       * @param int   $per_page
 879       * @param array $to_display List of pages to be displayed. Passed by reference.
 880       */
 881  	private function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page, &$to_display ) {
 882          if ( ! isset( $children_pages[ $parent ] ) ) {
 883              return;
 884          }
 885  
 886          $start = ( $pagenum - 1 ) * $per_page;
 887          $end   = $start + $per_page;
 888  
 889          foreach ( $children_pages[ $parent ] as $page ) {
 890              if ( $count >= $end ) {
 891                  break;
 892              }
 893  
 894              // If the page starts in a subtree, print the parents.
 895              if ( $count == $start && $page->post_parent > 0 ) {
 896                  $my_parents = array();
 897                  $my_parent  = $page->post_parent;
 898                  while ( $my_parent ) {
 899                      // Get the ID from the list or the attribute if my_parent is an object.
 900                      $parent_id = $my_parent;
 901                      if ( is_object( $my_parent ) ) {
 902                          $parent_id = $my_parent->ID;
 903                      }
 904  
 905                      $my_parent    = get_post( $parent_id );
 906                      $my_parents[] = $my_parent;
 907                      if ( ! $my_parent->post_parent ) {
 908                          break;
 909                      }
 910                      $my_parent = $my_parent->post_parent;
 911                  }
 912                  $num_parents = count( $my_parents );
 913                  while ( $my_parent = array_pop( $my_parents ) ) {
 914                      $to_display[ $my_parent->ID ] = $level - $num_parents;
 915                      $num_parents--;
 916                  }
 917              }
 918  
 919              if ( $count >= $start ) {
 920                  $to_display[ $page->ID ] = $level;
 921              }
 922  
 923              $count++;
 924  
 925              $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display );
 926          }
 927  
 928          unset( $children_pages[ $parent ] ); // Required in order to keep track of orphans.
 929      }
 930  
 931      /**
 932       * Handles the checkbox column output.
 933       *
 934       * @since 4.3.0
 935       *
 936       * @param WP_Post $post The current WP_Post object.
 937       */
 938  	public function column_cb( $post ) {
 939          $show = current_user_can( 'edit_post', $post->ID );
 940  
 941          /**
 942           * Filters whether to show the bulk edit checkbox for a post in its list table.
 943           *
 944           * By default the checkbox is only shown if the current user can edit the post.
 945           *
 946           * @since 5.7.0
 947           *
 948           * @param bool    $show Whether to show the checkbox.
 949           * @param WP_Post $post The current WP_Post object.
 950           */
 951          if ( apply_filters( 'wp_list_table_show_post_checkbox', $show, $post ) ) :
 952              ?>
 953              <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>">
 954                  <?php
 955                      /* translators: %s: Post title. */
 956                      printf( __( 'Select %s' ), _draft_or_post_title() );
 957                  ?>
 958              </label>
 959              <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
 960              <div class="locked-indicator">
 961                  <span class="locked-indicator-icon" aria-hidden="true"></span>
 962                  <span class="screen-reader-text">
 963                  <?php
 964                  printf(
 965                      /* translators: %s: Post title. */
 966                      __( '&#8220;%s&#8221; is locked' ),
 967                      _draft_or_post_title()
 968                  );
 969                  ?>
 970                  </span>
 971              </div>
 972              <?php
 973          endif;
 974      }
 975  
 976      /**
 977       * @since 4.3.0
 978       *
 979       * @param WP_Post $post
 980       * @param string  $classes
 981       * @param string  $data
 982       * @param string  $primary
 983       */
 984  	protected function _column_title( $post, $classes, $data, $primary ) {
 985          echo '<td class="' . $classes . ' page-title" ', $data, '>';
 986          echo $this->column_title( $post );
 987          echo $this->handle_row_actions( $post, 'title', $primary );
 988          echo '</td>';
 989      }
 990  
 991      /**
 992       * Handles the title column output.
 993       *
 994       * @since 4.3.0
 995       *
 996       * @global string $mode List table view mode.
 997       *
 998       * @param WP_Post $post The current WP_Post object.
 999       */
1000  	public function column_title( $post ) {
1001          global $mode;
1002  
1003          if ( $this->hierarchical_display ) {
1004              if ( 0 === $this->current_level && (int) $post->post_parent > 0 ) {
1005                  // Sent level 0 by accident, by default, or because we don't know the actual level.
1006                  $find_main_page = (int) $post->post_parent;
1007                  while ( $find_main_page > 0 ) {
1008                      $parent = get_post( $find_main_page );
1009  
1010                      if ( is_null( $parent ) ) {
1011                          break;
1012                      }
1013  
1014                      $this->current_level++;
1015                      $find_main_page = (int) $parent->post_parent;
1016  
1017                      if ( ! isset( $parent_name ) ) {
1018                          /** This filter is documented in wp-includes/post-template.php */
1019                          $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );
1020                      }
1021                  }
1022              }
1023          }
1024  
1025          $can_edit_post = current_user_can( 'edit_post', $post->ID );
1026  
1027          if ( $can_edit_post && 'trash' !== $post->post_status ) {
1028              $lock_holder = wp_check_post_lock( $post->ID );
1029  
1030              if ( $lock_holder ) {
1031                  $lock_holder   = get_userdata( $lock_holder );
1032                  $locked_avatar = get_avatar( $lock_holder->ID, 18 );
1033                  /* translators: %s: User's display name. */
1034                  $locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
1035              } else {
1036                  $locked_avatar = '';
1037                  $locked_text   = '';
1038              }
1039  
1040              echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n";
1041          }
1042  
1043          $pad = str_repeat( '&#8212; ', $this->current_level );
1044          echo '<strong>';
1045  
1046          $title = _draft_or_post_title();
1047  
1048          if ( $can_edit_post && 'trash' !== $post->post_status ) {
1049              printf(
1050                  '<a class="row-title" href="%s" aria-label="%s">%s%s</a>',
1051                  get_edit_post_link( $post->ID ),
1052                  /* translators: %s: Post title. */
1053                  esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $title ) ),
1054                  $pad,
1055                  $title
1056              );
1057          } else {
1058              printf(
1059                  '<span>%s%s</span>',
1060                  $pad,
1061                  $title
1062              );
1063          }
1064          _post_states( $post );
1065  
1066          if ( isset( $parent_name ) ) {
1067              $post_type_object = get_post_type_object( $post->post_type );
1068              echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name );
1069          }
1070          echo "</strong>\n";
1071  
1072          if ( 'excerpt' === $mode
1073              && ! is_post_type_hierarchical( $this->screen->post_type )
1074              && current_user_can( 'read_post', $post->ID )
1075          ) {
1076              if ( post_password_required( $post ) ) {
1077                  echo '<span class="protected-post-excerpt">' . esc_html( get_the_excerpt() ) . '</span>';
1078              } else {
1079                  echo esc_html( get_the_excerpt() );
1080              }
1081          }
1082  
1083          get_inline_data( $post );
1084      }
1085  
1086      /**
1087       * Handles the post date column output.
1088       *
1089       * @since 4.3.0
1090       *
1091       * @global string $mode List table view mode.
1092       *
1093       * @param WP_Post $post The current WP_Post object.
1094       */
1095  	public function column_date( $post ) {
1096          global $mode;
1097  
1098          if ( '0000-00-00 00:00:00' === $post->post_date ) {
1099              $t_time    = __( 'Unpublished' );
1100              $time_diff = 0;
1101          } else {
1102              $t_time = sprintf(
1103                  /* translators: 1: Post date, 2: Post time. */
1104                  __( '%1$s at %2$s' ),
1105                  /* translators: Post date format. See https://www.php.net/manual/datetime.format.php */
1106                  get_the_time( __( 'Y/m/d' ), $post ),
1107                  /* translators: Post time format. See https://www.php.net/manual/datetime.format.php */
1108                  get_the_time( __( 'g:i a' ), $post )
1109              );
1110  
1111              $time      = get_post_timestamp( $post );
1112              $time_diff = time() - $time;
1113          }
1114  
1115          if ( 'publish' === $post->post_status ) {
1116              $status = __( 'Published' );
1117          } elseif ( 'future' === $post->post_status ) {
1118              if ( $time_diff > 0 ) {
1119                  $status = '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
1120              } else {
1121                  $status = __( 'Scheduled' );
1122              }
1123          } else {
1124              $status = __( 'Last Modified' );
1125          }
1126  
1127          /**
1128           * Filters the status text of the post.
1129           *
1130           * @since 4.8.0
1131           *
1132           * @param string  $status      The status text.
1133           * @param WP_Post $post        Post object.
1134           * @param string  $column_name The column name.
1135           * @param string  $mode        The list display mode ('excerpt' or 'list').
1136           */
1137          $status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode );
1138  
1139          if ( $status ) {
1140              echo $status . '<br />';
1141          }
1142  
1143          /**
1144           * Filters the published time of the post.
1145           *
1146           * @since 2.5.1
1147           * @since 5.5.0 Removed the difference between 'excerpt' and 'list' modes.
1148           *              The published time and date are both displayed now,
1149           *              which is equivalent to the previous 'excerpt' mode.
1150           *
1151           * @param string  $t_time      The published time.
1152           * @param WP_Post $post        Post object.
1153           * @param string  $column_name The column name.
1154           * @param string  $mode        The list display mode ('excerpt' or 'list').
1155           */
1156          echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode );
1157      }
1158  
1159      /**
1160       * Handles the comments column output.
1161       *
1162       * @since 4.3.0
1163       *
1164       * @param WP_Post $post The current WP_Post object.
1165       */
1166  	public function column_comments( $post ) {
1167          ?>
1168          <div class="post-com-count-wrapper">
1169          <?php
1170              $pending_comments = isset( $this->comment_pending_count[ $post->ID ] ) ? $this->comment_pending_count[ $post->ID ] : 0;
1171  
1172              $this->comments_bubble( $post->ID, $pending_comments );
1173          ?>
1174          </div>
1175          <?php
1176      }
1177  
1178      /**
1179       * Handles the post author column output.
1180       *
1181       * @since 4.3.0
1182       *
1183       * @param WP_Post $post The current WP_Post object.
1184       */
1185  	public function column_author( $post ) {
1186          $args = array(
1187              'post_type' => $post->post_type,
1188              'author'    => get_the_author_meta( 'ID' ),
1189          );
1190          echo $this->get_edit_link( $args, get_the_author() );
1191      }
1192  
1193      /**
1194       * Handles the default column output.
1195       *
1196       * @since 4.3.0
1197       *
1198       * @param WP_Post $post        The current WP_Post object.
1199       * @param string  $column_name The current column name.
1200       */
1201  	public function column_default( $post, $column_name ) {
1202          if ( 'categories' === $column_name ) {
1203              $taxonomy = 'category';
1204          } elseif ( 'tags' === $column_name ) {
1205              $taxonomy = 'post_tag';
1206          } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) {
1207              $taxonomy = substr( $column_name, 9 );
1208          } else {
1209              $taxonomy = false;
1210          }
1211          if ( $taxonomy ) {
1212              $taxonomy_object = get_taxonomy( $taxonomy );
1213              $terms           = get_the_terms( $post->ID, $taxonomy );
1214              if ( is_array( $terms ) ) {
1215                  $term_links = array();
1216                  foreach ( $terms as $t ) {
1217                      $posts_in_term_qv = array();
1218                      if ( 'post' !== $post->post_type ) {
1219                          $posts_in_term_qv['post_type'] = $post->post_type;
1220                      }
1221                      if ( $taxonomy_object->query_var ) {
1222                          $posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug;
1223                      } else {
1224                          $posts_in_term_qv['taxonomy'] = $taxonomy;
1225                          $posts_in_term_qv['term']     = $t->slug;
1226                      }
1227  
1228                      $label = esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) );
1229  
1230                      $term_links[] = $this->get_edit_link( $posts_in_term_qv, $label );
1231                  }
1232  
1233                  /**
1234                   * Filters the links in `$taxonomy` column of edit.php.
1235                   *
1236                   * @since 5.2.0
1237                   *
1238                   * @param string[]  $term_links Array of term editing links.
1239                   * @param string    $taxonomy   Taxonomy name.
1240                   * @param WP_Term[] $terms      Array of term objects appearing in the post row.
1241                   */
1242                  $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms );
1243  
1244                  /* translators: Used between list items, there is a space after the comma. */
1245                  echo implode( __( ', ' ), $term_links );
1246              } else {
1247                  echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>';
1248              }
1249              return;
1250          }
1251  
1252          if ( is_post_type_hierarchical( $post->post_type ) ) {
1253  
1254              /**
1255               * Fires in each custom column on the Posts list table.
1256               *
1257               * This hook only fires if the current post type is hierarchical,
1258               * such as pages.
1259               *
1260               * @since 2.5.0
1261               *
1262               * @param string $column_name The name of the column to display.
1263               * @param int    $post_id     The current post ID.
1264               */
1265              do_action( 'manage_pages_custom_column', $column_name, $post->ID );
1266          } else {
1267  
1268              /**
1269               * Fires in each custom column in the Posts list table.
1270               *
1271               * This hook only fires if the current post type is non-hierarchical,
1272               * such as posts.
1273               *
1274               * @since 1.5.0
1275               *
1276               * @param string $column_name The name of the column to display.
1277               * @param int    $post_id     The current post ID.
1278               */
1279              do_action( 'manage_posts_custom_column', $column_name, $post->ID );
1280          }
1281  
1282          /**
1283           * Fires for each custom column of a specific post type in the Posts list table.
1284           *
1285           * The dynamic portion of the hook name, `$post->post_type`, refers to the post type.
1286           *
1287           * Possible hook names include:
1288           *
1289           *  - `manage_post_posts_custom_column`
1290           *  - `manage_page_posts_custom_column`
1291           *
1292           * @since 3.1.0
1293           *
1294           * @param string $column_name The name of the column to display.
1295           * @param int    $post_id     The current post ID.
1296           */
1297          do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID );
1298      }
1299  
1300      /**
1301       * @global WP_Post $post Global post object.
1302       *
1303       * @param int|WP_Post $post
1304       * @param int         $level
1305       */
1306  	public function single_row( $post, $level = 0 ) {
1307          $global_post = get_post();
1308  
1309          $post                = get_post( $post );
1310          $this->current_level = $level;
1311  
1312          $GLOBALS['post'] = $post;
1313          setup_postdata( $post );
1314  
1315          $classes = 'iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
1316  
1317          $lock_holder = wp_check_post_lock( $post->ID );
1318          if ( $lock_holder ) {
1319              $classes .= ' wp-locked';
1320          }
1321  
1322          if ( $post->post_parent ) {
1323              $count    = count( get_post_ancestors( $post->ID ) );
1324              $classes .= ' level-' . $count;
1325          } else {
1326              $classes .= ' level-0';
1327          }
1328          ?>
1329          <tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>">
1330              <?php $this->single_row_columns( $post ); ?>
1331          </tr>
1332          <?php
1333          $GLOBALS['post'] = $global_post;
1334      }
1335  
1336      /**
1337       * Gets the name of the default primary column.
1338       *
1339       * @since 4.3.0
1340       *
1341       * @return string Name of the default primary column, in this case, 'title'.
1342       */
1343  	protected function get_default_primary_column_name() {
1344          return 'title';
1345      }
1346  
1347      /**
1348       * Generates and displays row action links.
1349       *
1350       * @since 4.3.0
1351       *
1352       * @param WP_Post $post        Post being acted upon.
1353       * @param string  $column_name Current column name.
1354       * @param string  $primary     Primary column name.
1355       * @return string Row actions output for posts, or an empty string
1356       *                if the current column is not the primary column.
1357       */
1358  	protected function handle_row_actions( $post, $column_name, $primary ) {
1359          if ( $primary !== $column_name ) {
1360              return '';
1361          }
1362  
1363          $post_type_object = get_post_type_object( $post->post_type );
1364          $can_edit_post    = current_user_can( 'edit_post', $post->ID );
1365          $actions          = array();
1366          $title            = _draft_or_post_title();
1367  
1368          if ( $can_edit_post && 'trash' !== $post->post_status ) {
1369              $actions['edit'] = sprintf(
1370                  '<a href="%s" aria-label="%s">%s</a>',
1371                  get_edit_post_link( $post->ID ),
1372                  /* translators: %s: Post title. */
1373                  esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),
1374                  __( 'Edit' )
1375              );
1376  
1377              if ( 'wp_block' !== $post->post_type ) {
1378                  $actions['inline hide-if-no-js'] = sprintf(
1379                      '<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
1380                      /* translators: %s: Post title. */
1381                      esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $title ) ),
1382                      __( 'Quick&nbsp;Edit' )
1383                  );
1384              }
1385          }
1386  
1387          if ( current_user_can( 'delete_post', $post->ID ) ) {
1388              if ( 'trash' === $post->post_status ) {
1389                  $actions['untrash'] = sprintf(
1390                      '<a href="%s" aria-label="%s">%s</a>',
1391                      wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ),
1392                      /* translators: %s: Post title. */
1393                      esc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' ), $title ) ),
1394                      __( 'Restore' )
1395                  );
1396              } elseif ( EMPTY_TRASH_DAYS ) {
1397                  $actions['trash'] = sprintf(
1398                      '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
1399                      get_delete_post_link( $post->ID ),
1400                      /* translators: %s: Post title. */
1401                      esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $title ) ),
1402                      _x( 'Trash', 'verb' )
1403                  );
1404              }
1405              if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) {
1406                  $actions['delete'] = sprintf(
1407                      '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
1408                      get_delete_post_link( $post->ID, '', true ),
1409                      /* translators: %s: Post title. */
1410                      esc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $title ) ),
1411                      __( 'Delete Permanently' )
1412                  );
1413              }
1414          }
1415  
1416          if ( is_post_type_viewable( $post_type_object ) ) {
1417              if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ), true ) ) {
1418                  if ( $can_edit_post ) {
1419                      $preview_link    = get_preview_post_link( $post );
1420                      $actions['view'] = sprintf(
1421                          '<a href="%s" rel="bookmark" aria-label="%s">%s</a>',
1422                          esc_url( $preview_link ),
1423                          /* translators: %s: Post title. */
1424                          esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ),
1425                          __( 'Preview' )
1426                      );
1427                  }
1428              } elseif ( 'trash' !== $post->post_status ) {
1429                  $actions['view'] = sprintf(
1430                      '<a href="%s" rel="bookmark" aria-label="%s">%s</a>',
1431                      get_permalink( $post->ID ),
1432                      /* translators: %s: Post title. */
1433                      esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ),
1434                      __( 'View' )
1435                  );
1436              }
1437          }
1438  
1439          if ( 'wp_block' === $post->post_type ) {
1440              $actions['export'] = sprintf(
1441                  '<button type="button" class="wp-list-reusable-blocks__export button-link" data-id="%s" aria-label="%s">%s</button>',
1442                  $post->ID,
1443                  /* translators: %s: Post title. */
1444                  esc_attr( sprintf( __( 'Export &#8220;%s&#8221; as JSON' ), $title ) ),
1445                  __( 'Export as JSON' )
1446              );
1447          }
1448  
1449          if ( is_post_type_hierarchical( $post->post_type ) ) {
1450  
1451              /**
1452               * Filters the array of row action links on the Pages list table.
1453               *
1454               * The filter is evaluated only for hierarchical post types.
1455               *
1456               * @since 2.8.0
1457               *
1458               * @param string[] $actions An array of row action links. Defaults are
1459               *                          'Edit', 'Quick Edit', 'Restore', 'Trash',
1460               *                          'Delete Permanently', 'Preview', and 'View'.
1461               * @param WP_Post  $post    The post object.
1462               */
1463              $actions = apply_filters( 'page_row_actions', $actions, $post );
1464          } else {
1465  
1466              /**
1467               * Filters the array of row action links on the Posts list table.
1468               *
1469               * The filter is evaluated only for non-hierarchical post types.
1470               *
1471               * @since 2.8.0
1472               *
1473               * @param string[] $actions An array of row action links. Defaults are
1474               *                          'Edit', 'Quick Edit', 'Restore', 'Trash',
1475               *                          'Delete Permanently', 'Preview', and 'View'.
1476               * @param WP_Post  $post    The post object.
1477               */
1478              $actions = apply_filters( 'post_row_actions', $actions, $post );
1479          }
1480  
1481          return $this->row_actions( $actions );
1482      }
1483  
1484      /**
1485       * Outputs the hidden row displayed when inline editing
1486       *
1487       * @since 3.1.0
1488       *
1489       * @global string $mode List table view mode.
1490       */
1491  	public function inline_edit() {
1492          global $mode;
1493  
1494          $screen = $this->screen;
1495  
1496          $post             = get_default_post_to_edit( $screen->post_type );
1497          $post_type_object = get_post_type_object( $screen->post_type );
1498  
1499          $taxonomy_names          = get_object_taxonomies( $screen->post_type );
1500          $hierarchical_taxonomies = array();
1501          $flat_taxonomies         = array();
1502  
1503          foreach ( $taxonomy_names as $taxonomy_name ) {
1504  
1505              $taxonomy = get_taxonomy( $taxonomy_name );
1506  
1507              $show_in_quick_edit = $taxonomy->show_in_quick_edit;
1508  
1509              /**
1510               * Filters whether the current taxonomy should be shown in the Quick Edit panel.
1511               *
1512               * @since 4.2.0
1513               *
1514               * @param bool   $show_in_quick_edit Whether to show the current taxonomy in Quick Edit.
1515               * @param string $taxonomy_name      Taxonomy name.
1516               * @param string $post_type          Post type of current Quick Edit post.
1517               */
1518              if ( ! apply_filters( 'quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type ) ) {
1519                  continue;
1520              }
1521  
1522              if ( $taxonomy->hierarchical ) {
1523                  $hierarchical_taxonomies[] = $taxonomy;
1524              } else {
1525                  $flat_taxonomies[] = $taxonomy;
1526              }
1527          }
1528  
1529          $m            = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list';
1530          $can_publish  = current_user_can( $post_type_object->cap->publish_posts );
1531          $core_columns = array(
1532              'cb'         => true,
1533              'date'       => true,
1534              'title'      => true,
1535              'categories' => true,
1536              'tags'       => true,
1537              'comments'   => true,
1538              'author'     => true,
1539          );
1540  
1541          ?>
1542  
1543          <form method="get">
1544          <table style="display: none"><tbody id="inlineedit">
1545          <?php
1546          $hclass              = count( $hierarchical_taxonomies ) ? 'post' : 'page';
1547          $inline_edit_classes = "inline-edit-row inline-edit-row-$hclass";
1548          $bulk_edit_classes   = "bulk-edit-row bulk-edit-row-$hclass bulk-edit-{$screen->post_type}";
1549          $quick_edit_classes  = "quick-edit-row quick-edit-row-$hclass inline-edit-{$screen->post_type}";
1550  
1551          $bulk = 0;
1552          while ( $bulk < 2 ) :
1553              $classes  = $inline_edit_classes . ' ';
1554              $classes .= $bulk ? $bulk_edit_classes : $quick_edit_classes;
1555              ?>
1556              <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="<?php echo $classes; ?>" style="display: none">
1557              <td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
1558  
1559              <fieldset class="inline-edit-col-left">
1560                  <legend class="inline-edit-legend"><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></legend>
1561                  <div class="inline-edit-col">
1562  
1563                  <?php if ( post_type_supports( $screen->post_type, 'title' ) ) : ?>
1564  
1565                      <?php if ( $bulk ) : ?>
1566  
1567                          <div id="bulk-title-div">
1568                              <div id="bulk-titles"></div>
1569                          </div>
1570  
1571                      <?php else : // $bulk ?>
1572  
1573                          <label>
1574                              <span class="title"><?php _e( 'Title' ); ?></span>
1575                              <span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
1576                          </label>
1577  
1578                          <?php if ( is_post_type_viewable( $screen->post_type ) ) : ?>
1579  
1580                              <label>
1581                                  <span class="title"><?php _e( 'Slug' ); ?></span>
1582                                  <span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
1583                              </label>
1584  
1585                          <?php endif; // is_post_type_viewable() ?>
1586  
1587                      <?php endif; // $bulk ?>
1588  
1589                  <?php endif; // post_type_supports( ... 'title' ) ?>
1590  
1591                  <?php if ( ! $bulk ) : ?>
1592                      <fieldset class="inline-edit-date">
1593                          <legend><span class="title"><?php _e( 'Date' ); ?></span></legend>
1594                          <?php touch_time( 1, 1, 0, 1 ); ?>
1595                      </fieldset>
1596                      <br class="clear" />
1597                  <?php endif; // $bulk ?>
1598  
1599                  <?php
1600                  if ( post_type_supports( $screen->post_type, 'author' ) ) :
1601                      $authors_dropdown = '';
1602  
1603                      if ( current_user_can( $post_type_object->cap->edit_others_posts ) ) :
1604                          $users_opt = array(
1605                              'hide_if_only_one_author' => false,
1606                              'who'                     => 'authors',
1607                              'name'                    => 'post_author',
1608                              'class'                   => 'authors',
1609                              'multi'                   => 1,
1610                              'echo'                    => 0,
1611                              'show'                    => 'display_name_with_login',
1612                          );
1613  
1614                          if ( $bulk ) {
1615                              $users_opt['show_option_none'] = __( '&mdash; No Change &mdash;' );
1616                          }
1617  
1618                          /**
1619                           * Filters the arguments used to generate the Quick Edit authors drop-down.
1620                           *
1621                           * @since 5.6.0
1622                           *
1623                           * @see wp_dropdown_users()
1624                           *
1625                           * @param array $users_opt An array of arguments passed to wp_dropdown_users().
1626                           * @param bool  $bulk      A flag to denote if it's a bulk action.
1627                           */
1628                          $users_opt = apply_filters( 'quick_edit_dropdown_authors_args', $users_opt, $bulk );
1629  
1630                          $authors = wp_dropdown_users( $users_opt );
1631                          if ( $authors ) :
1632                              $authors_dropdown  = '<label class="inline-edit-author">';
1633                              $authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
1634                              $authors_dropdown .= $authors;
1635                              $authors_dropdown .= '</label>';
1636                          endif;
1637                      endif; // current_user_can( 'edit_others_posts' )
1638                      ?>
1639  
1640                      <?php
1641                      if ( ! $bulk ) {
1642                          echo $authors_dropdown;
1643                      }
1644                  endif; // post_type_supports( ... 'author' )
1645                  ?>
1646  
1647                  <?php if ( ! $bulk && $can_publish ) : ?>
1648  
1649                      <div class="inline-edit-group wp-clearfix">
1650                          <label class="alignleft">
1651                              <span class="title"><?php _e( 'Password' ); ?></span>
1652                              <span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
1653                          </label>
1654  
1655                          <span class="alignleft inline-edit-or">
1656                              <?php
1657                              /* translators: Between password field and private checkbox on post quick edit interface. */
1658                              _e( '&ndash;OR&ndash;' );
1659                              ?>
1660                          </span>
1661                          <label class="alignleft inline-edit-private">
1662                              <input type="checkbox" name="keep_private" value="private" />
1663                              <span class="checkbox-title"><?php _e( 'Private' ); ?></span>
1664                          </label>
1665                      </div>
1666  
1667                  <?php endif; ?>
1668  
1669                  </div>
1670              </fieldset>
1671  
1672              <?php if ( count( $hierarchical_taxonomies ) && ! $bulk ) : ?>
1673  
1674                  <fieldset class="inline-edit-col-center inline-edit-categories">
1675                      <div class="inline-edit-col">
1676  
1677                      <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
1678  
1679                          <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
1680                          <input type="hidden" name="<?php echo ( 'category' === $taxonomy->name ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
1681                          <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist">
1682                              <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>
1683                          </ul>
1684  
1685                      <?php endforeach; // $hierarchical_taxonomies as $taxonomy ?>
1686  
1687                      </div>
1688                  </fieldset>
1689  
1690              <?php endif; // count( $hierarchical_taxonomies ) && ! $bulk ?>
1691  
1692              <fieldset class="inline-edit-col-right">
1693                  <div class="inline-edit-col">
1694  
1695                  <?php
1696                  if ( post_type_supports( $screen->post_type, 'author' ) && $bulk ) {
1697                      echo $authors_dropdown;
1698                  }
1699                  ?>
1700  
1701                  <?php if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) : ?>
1702  
1703                      <?php if ( $post_type_object->hierarchical ) : ?>
1704  
1705                          <label>
1706                              <span class="title"><?php _e( 'Parent' ); ?></span>
1707                              <?php
1708                              $dropdown_args = array(
1709                                  'post_type'         => $post_type_object->name,
1710                                  'selected'          => $post->post_parent,
1711                                  'name'              => 'post_parent',
1712                                  'show_option_none'  => __( 'Main Page (no parent)' ),
1713                                  'option_none_value' => 0,
1714                                  'sort_column'       => 'menu_order, post_title',
1715                              );
1716  
1717                              if ( $bulk ) {
1718                                  $dropdown_args['show_option_no_change'] = __( '&mdash; No Change &mdash;' );
1719                              }
1720  
1721                              /**
1722                               * Filters the arguments used to generate the Quick Edit page-parent drop-down.
1723                               *
1724                               * @since 2.7.0
1725                               * @since 5.6.0 The `$bulk` parameter was added.
1726                               *
1727                               * @see wp_dropdown_pages()
1728                               *
1729                               * @param array $dropdown_args An array of arguments passed to wp_dropdown_pages().
1730                               * @param bool  $bulk          A flag to denote if it's a bulk action.
1731                               */
1732                              $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args, $bulk );
1733  
1734                              wp_dropdown_pages( $dropdown_args );
1735                              ?>
1736                          </label>
1737  
1738                      <?php endif; // hierarchical ?>
1739  
1740                      <?php if ( ! $bulk ) : ?>
1741  
1742                          <label>
1743                              <span class="title"><?php _e( 'Order' ); ?></span>
1744                              <span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order; ?>" /></span>
1745                          </label>
1746  
1747                      <?php endif; // ! $bulk ?>
1748  
1749                  <?php endif; // post_type_supports( ... 'page-attributes' ) ?>
1750  
1751                  <?php if ( 0 < count( get_page_templates( null, $screen->post_type ) ) ) : ?>
1752  
1753                      <label>
1754                          <span class="title"><?php _e( 'Template' ); ?></span>
1755                          <select name="page_template">
1756                              <?php if ( $bulk ) : ?>
1757                              <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
1758                              <?php endif; // $bulk ?>
1759                              <?php
1760                              /** This filter is documented in wp-admin/includes/meta-boxes.php */
1761                              $default_title = apply_filters( 'default_page_template_title', __( 'Default template' ), 'quick-edit' );
1762                              ?>
1763                              <option value="default"><?php echo esc_html( $default_title ); ?></option>
1764                              <?php page_template_dropdown( '', $screen->post_type ); ?>
1765                          </select>
1766                      </label>
1767  
1768                  <?php endif; ?>
1769  
1770                  <?php if ( count( $flat_taxonomies ) && ! $bulk ) : ?>
1771  
1772                      <?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
1773  
1774                          <?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) : ?>
1775                              <?php $taxonomy_name = esc_attr( $taxonomy->name ); ?>
1776  
1777                              <label class="inline-edit-tags">
1778                                  <span class="title"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
1779                                  <textarea data-wp-taxonomy="<?php echo $taxonomy_name; ?>" cols="22" rows="1" name="tax_input[<?php echo $taxonomy_name; ?>]" class="tax_input_<?php echo $taxonomy_name; ?>"></textarea>
1780                              </label>
1781  
1782                          <?php endif; // current_user_can( 'assign_terms' ) ?>
1783  
1784                      <?php endforeach; // $flat_taxonomies as $taxonomy ?>
1785  
1786                  <?php endif; // count( $flat_taxonomies ) && ! $bulk ?>
1787  
1788                  <?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
1789  
1790                      <?php if ( $bulk ) : ?>
1791  
1792                          <div class="inline-edit-group wp-clearfix">
1793  
1794                          <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
1795  
1796                              <label class="alignleft">
1797                                  <span class="title"><?php _e( 'Comments' ); ?></span>
1798                                  <select name="comment_status">
1799                                      <option value=""><?php _e( '&mdash; No Change &mdash;' ); ?></option>
1800                                      <option value="open"><?php _e( 'Allow' ); ?></option>
1801                                      <option value="closed"><?php _e( 'Do not allow' ); ?></option>
1802                                  </select>
1803                              </label>
1804  
1805                          <?php endif; ?>
1806  
1807                          <?php if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
1808  
1809                              <label class="alignright">
1810                                  <span class="title"><?php _e( 'Pings' ); ?></span>
1811                                  <select name="ping_status">
1812                                      <option value=""><?php _e( '&mdash; No Change &mdash;' ); ?></option>
1813                                      <option value="open"><?php _e( 'Allow' ); ?></option>
1814                                      <option value="closed"><?php _e( 'Do not allow' ); ?></option>
1815                                  </select>
1816                              </label>
1817  
1818                          <?php endif; ?>
1819  
1820                          </div>
1821  
1822                      <?php else : // $bulk ?>
1823  
1824                          <div class="inline-edit-group wp-clearfix">
1825  
1826                          <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
1827  
1828                              <label class="alignleft">
1829                                  <input type="checkbox" name="comment_status" value="open" />
1830                                  <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
1831                              </label>
1832  
1833                          <?php endif; ?>
1834  
1835                          <?php if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
1836  
1837                              <label class="alignleft">
1838                                  <input type="checkbox" name="ping_status" value="open" />
1839                                  <span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span>
1840                              </label>
1841  
1842                          <?php endif; ?>
1843  
1844                          </div>
1845  
1846                      <?php endif; // $bulk ?>
1847  
1848                  <?php endif; // post_type_supports( ... comments or pings ) ?>
1849  
1850                      <div class="inline-edit-group wp-clearfix">
1851  
1852                          <label class="inline-edit-status alignleft">
1853                              <span class="title"><?php _e( 'Status' ); ?></span>
1854                              <select name="_status">
1855                                  <?php if ( $bulk ) : ?>
1856                                      <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
1857                                  <?php endif; // $bulk ?>
1858  
1859                                  <?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review". ?>
1860                                      <option value="publish"><?php _e( 'Published' ); ?></option>
1861                                      <option value="future"><?php _e( 'Scheduled' ); ?></option>
1862                                      <?php if ( $bulk ) : ?>
1863                                          <option value="private"><?php _e( 'Private' ); ?></option>
1864                                      <?php endif; // $bulk ?>
1865                                  <?php endif; ?>
1866  
1867                                  <option value="pending"><?php _e( 'Pending Review' ); ?></option>
1868                                  <option value="draft"><?php _e( 'Draft' ); ?></option>
1869                              </select>
1870                          </label>
1871  
1872                          <?php if ( 'post' === $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
1873  
1874                              <?php if ( $bulk ) : ?>
1875  
1876                                  <label class="alignright">
1877                                      <span class="title"><?php _e( 'Sticky' ); ?></span>
1878                                      <select name="sticky">
1879                                          <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
1880                                          <option value="sticky"><?php _e( 'Sticky' ); ?></option>
1881                                          <option value="unsticky"><?php _e( 'Not Sticky' ); ?></option>
1882                                      </select>
1883                                  </label>
1884  
1885                              <?php else : // $bulk ?>
1886  
1887                                  <label class="alignleft">
1888                                      <input type="checkbox" name="sticky" value="sticky" />
1889                                      <span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
1890                                  </label>
1891  
1892                              <?php endif; // $bulk ?>
1893  
1894                          <?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_posts' ) ?>
1895  
1896                      </div>
1897  
1898                  <?php if ( $bulk && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) ) : ?>
1899                      <?php $post_formats = get_theme_support( 'post-formats' ); ?>
1900  
1901                      <label class="alignleft">
1902                          <span class="title"><?php _ex( 'Format', 'post format' ); ?></span>
1903                          <select name="post_format">
1904                              <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
1905                              <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
1906                              <?php if ( is_array( $post_formats[0] ) ) : ?>
1907                                  <?php foreach ( $post_formats[0] as $format ) : ?>
1908                                      <option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
1909                                  <?php endforeach; ?>
1910                              <?php endif; ?>
1911                          </select>
1912                      </label>
1913  
1914                  <?php endif; ?>
1915  
1916                  </div>
1917              </fieldset>
1918  
1919              <?php
1920              list( $columns ) = $this->get_column_info();
1921  
1922              foreach ( $columns as $column_name => $column_display_name ) {
1923                  if ( isset( $core_columns[ $column_name ] ) ) {
1924                      continue;
1925                  }
1926  
1927                  if ( $bulk ) {
1928  
1929                      /**
1930                       * Fires once for each column in Bulk Edit mode.
1931                       *
1932                       * @since 2.7.0
1933                       *
1934                       * @param string $column_name Name of the column to edit.
1935                       * @param string $post_type   The post type slug.
1936                       */
1937                      do_action( 'bulk_edit_custom_box', $column_name, $screen->post_type );
1938                  } else {
1939  
1940                      /**
1941                       * Fires once for each column in Quick Edit mode.
1942                       *
1943                       * @since 2.7.0
1944                       *
1945                       * @param string $column_name Name of the column to edit.
1946                       * @param string $post_type   The post type slug, or current screen name if this is a taxonomy list table.
1947                       * @param string $taxonomy    The taxonomy name, if any.
1948                       */
1949                      do_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' );
1950                  }
1951              }
1952              ?>
1953  
1954              <div class="submit inline-edit-save">
1955                  <button type="button" class="button cancel alignleft"><?php _e( 'Cancel' ); ?></button>
1956  
1957                  <?php if ( ! $bulk ) : ?>
1958                      <?php wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?>
1959                      <button type="button" class="button button-primary save alignright"><?php _e( 'Update' ); ?></button>
1960                      <span class="spinner"></span>
1961                  <?php else : ?>
1962                      <?php submit_button( __( 'Update' ), 'primary alignright', 'bulk_edit', false ); ?>
1963                  <?php endif; ?>
1964  
1965                  <input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" />
1966                  <input type="hidden" name="screen" value="<?php echo esc_attr( $screen->id ); ?>" />
1967                  <?php if ( ! $bulk && ! post_type_supports( $screen->post_type, 'author' ) ) : ?>
1968                      <input type="hidden" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
1969                  <?php endif; ?>
1970                  <br class="clear" />
1971  
1972                  <div class="notice notice-error notice-alt inline hidden">
1973                      <p class="error"></p>
1974                  </div>
1975              </div>
1976  
1977              </td></tr>
1978  
1979              <?php
1980              $bulk++;
1981          endwhile;
1982          ?>
1983          </tbody></table>
1984          </form>
1985          <?php
1986      }
1987  }


Generated: Mon Apr 19 01:00:04 2021 Cross-referenced by PHPXref 0.7.1