X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/80b7979fccf09a75af3f4c111fa27060ae6dbf85..888fa4ed68091f3314f711c5f6fe75858bf5410b:/wp-admin/includes/class-wp-list-table.php diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 6de7abf5..3aa066d8 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -1,12 +1,4 @@ '', 'singular' => '', - 'ajax' => false + 'ajax' => false, + 'screen' => null, ) ); - $screen = get_current_screen(); + $this->screen = convert_to_screen( $args['screen'] ); - add_filter( "manage_{$screen->id}_columns", array( &$this, 'get_columns' ), 0 ); + add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 ); if ( !$args['plural'] ) - $args['plural'] = $screen->base; + $args['plural'] = $this->screen->base; $args['plural'] = sanitize_key( $args['plural'] ); $args['singular'] = sanitize_key( $args['singular'] ); @@ -98,7 +91,7 @@ class WP_List_Table { if ( $args['ajax'] ) { // wp_enqueue_script( 'list-table' ); - add_action( 'admin_footer', array( &$this, '_js_vars' ) ); + add_action( 'admin_footer', array( $this, '_js_vars' ) ); } } @@ -209,6 +202,10 @@ class WP_List_Table { echo ''; if ( ! empty( $_REQUEST['order'] ) ) echo ''; + if ( ! empty( $_REQUEST['post_mime_type'] ) ) + echo ''; + if ( ! empty( $_REQUEST['detached'] ) ) + echo ''; ?>
'; + $out = '
'; foreach ( $actions as $action => $link ) { ++$i; ( $i == $action_count ) ? $sep = '' : $sep = ' | '; @@ -366,6 +380,16 @@ class WP_List_Table { ORDER BY post_date DESC ", $post_type ) ); + /** + * Filter the 'Months' drop-down results. + * + * @since 3.7.0 + * + * @param object $months The months drop-down query results. + * @param string $post_type The post type. + */ + $months = apply_filters( 'months_dropdown_results', $months, $post_type ); + $month_count = count( $months ); if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) @@ -374,7 +398,7 @@ class WP_List_Table { $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0; ?> '; + $cb_counter++; + } + foreach ( $columns as $column_key => $column_display_name ) { $class = array( 'manage-column', "column-$column_key" ); @@ -715,7 +765,7 @@ class WP_List_Table { $this->display_tablenav( 'top' ); ?> - +
print_column_headers(); ?> @@ -728,7 +778,7 @@ class WP_List_Table { - > + > display_rows_or_placeholder(); ?>
@@ -760,8 +810,8 @@ class WP_List_Table { ?>
-
- bulk_actions( $which ); ?> +
+ bulk_actions(); ?>
extra_tablenav( $which ); @@ -822,7 +872,7 @@ class WP_List_Table { $row_class = ( $row_class == '' ? ' class="alternate"' : '' ); echo ''; - echo $this->single_row_columns( $item ); + $this->single_row_columns( $item ); echo ''; } @@ -853,7 +903,7 @@ class WP_List_Table { } elseif ( method_exists( $this, 'column_' . $column_name ) ) { echo ""; - echo call_user_func( array( &$this, 'column_' . $column_name ), $item ); + echo call_user_func( array( $this, 'column_' . $column_name ), $item ); echo ""; } else { @@ -903,13 +953,11 @@ class WP_List_Table { * @access private */ function _js_vars() { - $current_screen = get_current_screen(); - $args = array( 'class' => get_class( $this ), 'screen' => array( - 'id' => $current_screen->id, - 'base' => $current_screen->base, + 'id' => $this->screen->id, + 'base' => $this->screen->base, ) );