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',
* in the list table, e.g. 'posts'. Default empty.
* @type string $singular Singular label for an object being listed, e.g. 'post'.
* Default empty
* in the list table, e.g. 'posts'. Default empty.
* @type string $singular Singular label for an object being listed, e.g. 'post'.
* Default empty
- * the {@see _js_vars()} method in the footer to provide variables
- * to any scripts handling AJAX events. Default false.
+ * the _js_vars() method in the footer to provide variables
+ * to any scripts handling Ajax events. Default false.
* @type string $screen String containing the hook name used to determine the current
* screen. If left null, the current screen will be automatically set.
* Default null.
* @type string $screen String containing the hook name used to determine the current
* screen. If left null, the current screen will be automatically set.
* Default null.
*/
protected function set_pagination_args( $args ) {
$args = wp_parse_args( $args, array(
*/
protected function set_pagination_args( $args ) {
$args = wp_parse_args( $args, array(
$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
// Redirect if page number is invalid and headers are not already sent.
$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
// Redirect if page number is invalid and headers are not already sent.
* @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 ) {
- * @param string $text The search button text
- * @param string $input_id The search input id
+ * @param string $text The 'submit' button label.
+ * @param string $input_id ID attribute value for the search input field.
*/
public function search_box( $text, $input_id ) {
if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
*/
public function search_box( $text, $input_id ) {
if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
- <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
- <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
- <?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
+ <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
+ <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" />
+ <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>
*
* The dynamic portion of the hook name, `$this->screen->id`, refers
* to the ID of the current screen, usually a string.
*
* The dynamic portion of the hook name, `$this->screen->id`, refers
* to the ID of the current screen, usually a string.
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";
*
* The dynamic portion of the hook name, `$this->screen->id`, refers
* to the ID of the current screen, usually a string.
*
* The dynamic portion of the hook name, `$this->screen->id`, refers
* to the ID of the current screen, usually a string.
* @param array $actions An array of the available bulk actions.
*/
$this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
* @param array $actions An array of the available bulk actions.
*/
$this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
- 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' )
+ );
*
* The dynamic hook name, $option, refers to the `per_page` option depending
* on the type of list table in use. Possible values include: 'edit_comments_per_page',
*
* The dynamic hook name, $option, refers to the `per_page` option depending
* on the type of list table in use. Possible values include: 'edit_comments_per_page',
$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();
// 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
*
* The dynamic portion of the hook name, `$this->screen->id`, refers
* to the ID of the current screen, usually a string.
*
* The dynamic portion of the hook name, `$this->screen->id`, refers
* to the ID of the current screen, usually a string.
$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.