diff -r be944660c56a -r 3d72ae0968f4 wp/wp-admin/includes/class-wp-posts-list-table.php --- a/wp/wp-admin/includes/class-wp-posts-list-table.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-admin/includes/class-wp-posts-list-table.php Tue Sep 27 16:37:53 2022 +0200 @@ -251,24 +251,24 @@ * * @since 4.4.0 * - * @param string[] $args Associative array of URL parameters for the link. - * @param string $label Link text. - * @param string $class Optional. Class attribute. Default empty string. + * @param string[] $args Associative array of URL parameters for the link. + * @param string $link_text Link text. + * @param string $css_class Optional. Class attribute. Default empty string. * @return string The formatted link string. */ - protected function get_edit_link( $args, $label, $class = '' ) { + protected function get_edit_link( $args, $link_text, $css_class = '' ) { $url = add_query_arg( $args, 'edit.php' ); $class_html = ''; $aria_current = ''; - if ( ! empty( $class ) ) { + if ( ! empty( $css_class ) ) { $class_html = sprintf( ' class="%s"', - esc_attr( $class ) + esc_attr( $css_class ) ); - if ( 'current' === $class ) { + if ( 'current' === $css_class ) { $aria_current = ' aria-current="page"'; } } @@ -278,7 +278,7 @@ esc_url( $url ), $class_html, $aria_current, - $label + $link_text ); } @@ -817,8 +817,8 @@ } /* - * Arrange pages into two parts: top level pages and children_pages - * children_pages is two dimensional array, eg. + * Arrange pages into two parts: top level pages and children_pages. + * children_pages is two dimensional array. Example: * children_pages[10][] contains all sub-pages whose parent is 10. * It only takes O( N ) to arrange this and it takes O( 1 ) for subsequent lookup operations * If searching, ignore hierarchy and treat everything as top level @@ -905,21 +905,21 @@ * * @param array $children_pages * @param int $count - * @param int $parent + * @param int $parent_page * @param int $level * @param int $pagenum * @param int $per_page * @param array $to_display List of pages to be displayed. Passed by reference. */ - private function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page, &$to_display ) { - if ( ! isset( $children_pages[ $parent ] ) ) { + private function _page_rows( &$children_pages, &$count, $parent_page, $level, $pagenum, $per_page, &$to_display ) { + if ( ! isset( $children_pages[ $parent_page ] ) ) { return; } $start = ( $pagenum - 1 ) * $per_page; $end = $start + $per_page; - foreach ( $children_pages[ $parent ] as $page ) { + foreach ( $children_pages[ $parent_page ] as $page ) { if ( $count >= $end ) { break; } @@ -964,17 +964,20 @@ $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); } - unset( $children_pages[ $parent ] ); // Required in order to keep track of orphans. + unset( $children_pages[ $parent_page ] ); // Required in order to keep track of orphans. } /** * Handles the checkbox column output. * * @since 4.3.0 + * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * - * @param WP_Post $post The current WP_Post object. + * @param WP_Post $item The current WP_Post object. */ - public function column_cb( $post ) { + public function column_cb( $item ) { + // Restores the more descriptive, specific name for use within this method. + $post = $item; $show = current_user_can( 'edit_post', $post->ID ); /** @@ -1235,11 +1238,15 @@ * Handles the default column output. * * @since 4.3.0 + * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * - * @param WP_Post $post The current WP_Post object. + * @param WP_Post $item The current WP_Post object. * @param string $column_name The current column name. */ - public function column_default( $post, $column_name ) { + public function column_default( $item, $column_name ) { + // Restores the more descriptive, specific name for use within this method. + $post = $item; + if ( 'categories' === $column_name ) { $taxonomy = 'category'; } elseif ( 'tags' === $column_name ) { @@ -1287,8 +1294,7 @@ */ $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms ); - /* translators: Used between list items, there is a space after the comma. */ - echo implode( __( ', ' ), $term_links ); + echo implode( wp_get_list_item_separator(), $term_links ); } else { echo '' . $taxonomy_object->labels->no_terms . ''; } @@ -1395,18 +1401,21 @@ * Generates and displays row action links. * * @since 4.3.0 + * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * - * @param WP_Post $post Post being acted upon. + * @param WP_Post $item Post being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for posts, or an empty string * if the current column is not the primary column. */ - protected function handle_row_actions( $post, $column_name, $primary ) { + protected function handle_row_actions( $item, $column_name, $primary ) { if ( $primary !== $column_name ) { return ''; } + // Restores the more descriptive, specific name for use within this method. + $post = $item; $post_type_object = get_post_type_object( $post->post_type ); $can_edit_post = current_user_can( 'edit_post', $post->ID ); $actions = array(); @@ -1602,9 +1611,9 @@ ?>