protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
protected $compat_methods = array( 'set_pagination_args', 'get_views', 'get_bulk_actions', 'bulk_actions',
'row_actions', 'months_dropdown', 'view_switcher', 'comments_bubble', 'get_items_per_page', 'pagination',
'get_sortable_columns', 'get_column_info', 'get_table_classes', 'display_tablenav', 'extra_tablenav',
protected $compat_methods = array( 'set_pagination_args', 'get_views', 'get_bulk_actions', 'bulk_actions',
'row_actions', 'months_dropdown', 'view_switcher', 'comments_bubble', 'get_items_per_page', 'pagination',
'get_sortable_columns', 'get_column_info', 'get_table_classes', 'display_tablenav', 'extra_tablenav',
*/
protected function set_pagination_args( $args ) {
$args = wp_parse_args( $args, array(
*/
protected function set_pagination_args( $args ) {
$args = wp_parse_args( $args, array(
* @return int Number of items that correspond to the given pagination argument.
*/
public function get_pagination_arg( $key ) {
* @return int Number of items that correspond to the given pagination argument.
*/
public function get_pagination_arg( $key ) {
echo "<ul class='subsubsub'>\n";
foreach ( $views as $class => $view ) {
$views[ $class ] = "\t<li class='$class'>$view";
echo "<ul class='subsubsub'>\n";
foreach ( $views as $class => $view ) {
$views[ $class ] = "\t<li class='$class'>$view";
- echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . __( 'Select bulk action' ) . "</label>";
- echo "<select name='action$two' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
- echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";
+ echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>';
+ echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n";
+ echo '<option value="-1">' . __( 'Bulk Actions' ) . "</option>\n";
+ $extra_checks = "AND post_status != 'auto-draft'";
+ if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {
+ $extra_checks .= " AND post_status != 'trash'";
+ } elseif ( isset( $_GET['post_status'] ) ) {
+ $extra_checks = $wpdb->prepare( ' AND post_status = %s', $_GET['post_status'] );
+ }
+
$months = $wpdb->get_results( $wpdb->prepare( "
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
FROM $wpdb->posts
WHERE post_type = %s
$months = $wpdb->get_results( $wpdb->prepare( "
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
FROM $wpdb->posts
WHERE post_type = %s
+ } else {
+ printf( '<span class="post-com-count post-com-count-pending post-com-count-no-pending"><span class="comment-count comment-count-no-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
+ $pending_comments_number,
+ $approved_comments ? __( 'No pending comments' ) : __( 'No comments' )
+ );
$output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
$current = $this->get_pagenum();
$output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
$current = $this->get_pagenum();
$html_current_page = $current;
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
} else {
$html_current_page = $current;
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
} else {
// We need a primary defined so responsive views show something,
// so let's fall back to the first non-checkbox column.
// We need a primary defined so responsive views show something,
// so let's fall back to the first non-checkbox column.
+ /**
+ * Public wrapper for WP_List_Table::get_default_primary_column_name().
+ *
+ * @since 4.4.0
+ * @access public
+ *
+ * @return string Name of the default primary column.
+ */
+ public function get_primary_column() {
+ return $this->get_primary_column_name();
+ }
+
$default = $this->get_default_primary_column_name();
// If the primary column doesn't exist fall back to the
$default = $this->get_default_primary_column_name();
// If the primary column doesn't exist fall back to the
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
$current_url = remove_query_arg( 'paged', $current_url );
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
$current_url = remove_query_arg( 'paged', $current_url );
$class[] = 'check-column';
elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
$class[] = 'num';
$class[] = 'check-column';
elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
$class[] = 'num';
if ( isset( $sortable[$column_key] ) ) {
list( $orderby, $desc_first ) = $sortable[$column_key];
if ( isset( $sortable[$column_key] ) ) {
list( $orderby, $desc_first ) = $sortable[$column_key];
* @param object $item The item being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @param object $item The item being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.