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 @@ ?> - +
- +
post_type, 'title' ) ) : ?> @@ -1626,7 +1635,7 @@ @@ -1648,39 +1657,45 @@ $authors_dropdown = ''; if ( current_user_can( $post_type_object->cap->edit_others_posts ) ) { - $users_opt = array( - 'hide_if_only_one_author' => false, - 'who' => 'authors', - 'name' => 'post_author', - 'class' => 'authors', - 'multi' => 1, - 'echo' => 0, - 'show' => 'display_name_with_login', - ); + $dropdown_name = 'post_author'; + $dropdown_class = 'authors'; + if ( wp_is_large_user_count() ) { + $authors_dropdown = sprintf( '', esc_attr( $dropdown_name ), esc_attr( $dropdown_class ) ); + } else { + $users_opt = array( + 'hide_if_only_one_author' => false, + 'capability' => array( $post_type_object->cap->edit_posts ), + 'name' => $dropdown_name, + 'class' => $dropdown_class, + 'multi' => 1, + 'echo' => 0, + 'show' => 'display_name_with_login', + ); - if ( $bulk ) { - $users_opt['show_option_none'] = __( '— No Change —' ); - } + if ( $bulk ) { + $users_opt['show_option_none'] = __( '— No Change —' ); + } - /** - * Filters the arguments used to generate the Quick Edit authors drop-down. - * - * @since 5.6.0 - * - * @see wp_dropdown_users() - * - * @param array $users_opt An array of arguments passed to wp_dropdown_users(). - * @param bool $bulk A flag to denote if it's a bulk action. - */ - $users_opt = apply_filters( 'quick_edit_dropdown_authors_args', $users_opt, $bulk ); + /** + * Filters the arguments used to generate the Quick Edit authors drop-down. + * + * @since 5.6.0 + * + * @see wp_dropdown_users() + * + * @param array $users_opt An array of arguments passed to wp_dropdown_users(). + * @param bool $bulk A flag to denote if it's a bulk action. + */ + $users_opt = apply_filters( 'quick_edit_dropdown_authors_args', $users_opt, $bulk ); - $authors = wp_dropdown_users( $users_opt ); + $authors = wp_dropdown_users( $users_opt ); - if ( $authors ) { - $authors_dropdown = ''; + if ( $authors ) { + $authors_dropdown = ''; + } } } // current_user_can( 'edit_others_posts' ) @@ -1725,7 +1740,7 @@ labels->name ); ?>
    - $taxonomy->name ) ); ?> + $taxonomy->name ) ); ?>
@@ -1819,12 +1834,13 @@ cap->assign_terms ) ) : ?> name ); ?> - +
- +

labels->separate_items_with_commas ); ?>

+
@@ -1998,14 +2014,17 @@ ?>
- - - + + + + + + + + - - @@ -2013,12 +2032,12 @@ post_type, 'author' ) ) : ?> -
+