diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/includes/class-wp-links-list-table.php --- a/wp/wp-admin/includes/class-wp-links-list-table.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/includes/class-wp-links-list-table.php Fri Sep 05 18:40:08 2025 +0200 @@ -11,7 +11,6 @@ * Core class used to implement displaying links in a list table. * * @since 3.1.0 - * @access private * * @see WP_List_Table */ @@ -51,7 +50,10 @@ public function prepare_items() { global $cat_id, $s, $orderby, $order; - wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) ); + $cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0; + $orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : ''; + $order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : ''; + $s = ! empty( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : ''; $args = array( 'hide_invisible' => 0, @@ -125,7 +127,7 @@ } /** - * @return array + * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { return array( @@ -144,15 +146,15 @@ */ protected function get_sortable_columns() { return array( - 'name' => 'name', - 'url' => 'url', - 'visible' => 'visible', - 'rating' => 'rating', + 'name' => array( 'name', false, _x( 'Name', 'link name' ), __( 'Table ordered by Name.' ), 'asc' ), + 'url' => array( 'url', false, __( 'URL' ), __( 'Table ordered by URL.' ) ), + 'visible' => array( 'visible', false, __( 'Visible' ), __( 'Table ordered by Visibility.' ) ), + 'rating' => array( 'rating', false, __( 'Rating' ), __( 'Table ordered by Rating.' ) ), ); } /** - * Get the name of the default primary column. + * Gets the name of the default primary column. * * @since 4.3.0 * @@ -175,13 +177,15 @@ $link = $item; ?> -