diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/includes/class-wp-posts-list-table.php
--- a/wp/wp-admin/includes/class-wp-posts-list-table.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/includes/class-wp-posts-list-table.php Fri Sep 05 18:40:08 2025 +0200
@@ -11,7 +11,6 @@
* Core class used to implement displaying posts in a list table.
*
* @since 3.1.0
- * @access private
*
* @see WP_List_Table
*/
@@ -66,7 +65,7 @@
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
- * @global WP_Post_Type $post_type_object
+ * @global WP_Post_Type $post_type_object Global post type object.
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param array $args An associative array of arguments.
@@ -227,7 +226,7 @@
}
/**
- * Determine if the current view is the "All" view.
+ * Determines if the current view is the "All" view.
*
* @since 4.2.0
*
@@ -247,7 +246,7 @@
}
/**
- * Helper to create links to edit.php with params.
+ * Creates a link to edit.php with params.
*
* @since 4.4.0
*
@@ -331,16 +330,16 @@
number_format_i18n( $this->user_posts_count )
);
- $mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class );
+ $mine = array(
+ 'url' => esc_url( add_query_arg( $mine_args, 'edit.php' ) ),
+ 'label' => $mine_inner_html,
+ 'current' => isset( $_GET['author'] ) && ( $current_user_id === (int) $_GET['author'] ),
+ );
$all_args['all_posts'] = 1;
$class = '';
}
- if ( empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ) ) {
- $class = 'current';
- }
-
$all_inner_html = sprintf(
/* translators: %s: Number of posts. */
_nx(
@@ -352,7 +351,11 @@
number_format_i18n( $total_posts )
);
- $status_links['all'] = $this->get_edit_link( $all_args, $all_inner_html, $class );
+ $status_links['all'] = array(
+ 'url' => esc_url( add_query_arg( $all_args, 'edit.php' ) ),
+ 'label' => $all_inner_html,
+ 'current' => empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ),
+ );
if ( $mine ) {
$status_links['mine'] = $mine;
@@ -381,7 +384,11 @@
number_format_i18n( $num_posts->$status_name )
);
- $status_links[ $status_name ] = $this->get_edit_link( $status_args, $status_label, $class );
+ $status_links[ $status_name ] = array(
+ 'url' => esc_url( add_query_arg( $status_args, 'edit.php' ) ),
+ 'label' => $status_label,
+ 'current' => isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'],
+ );
}
if ( ! empty( $this->sticky_posts_count ) ) {
@@ -404,7 +411,11 @@
);
$sticky_link = array(
- 'sticky' => $this->get_edit_link( $sticky_args, $sticky_inner_html, $class ),
+ 'sticky' => array(
+ 'url' => esc_url( add_query_arg( $sticky_args, 'edit.php' ) ),
+ 'label' => $sticky_inner_html,
+ 'current' => ! empty( $_REQUEST['show_sticky'] ),
+ ),
);
// Sticky comes after Publish, or if not listed, after All.
@@ -412,7 +423,7 @@
$status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );
}
- return $status_links;
+ return $this->get_views_links( $status_links );
}
/**
@@ -523,7 +534,12 @@
$displayed_post_format = isset( $_GET['post_format'] ) ? $_GET['post_format'] : '';
?>
-
+