diff -r be944660c56a -r 3d72ae0968f4 wp/wp-admin/includes/template.php --- a/wp/wp-admin/includes/template.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-admin/includes/template.php Tue Sep 27 16:37:53 2022 +0200 @@ -19,7 +19,7 @@ // /** - * Output an unordered list of checkbox input elements labeled with category names. + * Outputs an unordered list of checkbox input elements labeled with category names. * * @since 2.5.1 * @@ -52,7 +52,7 @@ } /** - * Output an unordered list of checkbox input elements labelled with term names. + * Outputs an unordered list of checkbox input elements labelled with term names. * * Taxonomy-independent version of wp_category_checklist(). * @@ -68,8 +68,8 @@ * @type int[] $selected_cats Array of category IDs to mark as checked. Default false. * @type int[] $popular_cats Array of category IDs to receive the "popular-category" class. * Default false. - * @type Walker $walker Walker object to use to build the output. - * Default is a Walker_Category_Checklist instance. + * @type Walker $walker Walker object to use to build the output. Default empty which + * results in a Walker_Category_Checklist instance being used. * @type string $taxonomy Taxonomy to generate the checklist for. Default 'category'. * @type bool $checked_ontop Whether to move checked items out of the hierarchy and to * the top of the list. Default true. @@ -96,8 +96,8 @@ * * @see wp_terms_checklist() * - * @param array $args An array of arguments. - * @param int $post_id The post ID. + * @param array|string $args An array or string of arguments. + * @param int $post_id The post ID. */ $params = apply_filters( 'wp_terms_checklist_args', $args, $post_id ); @@ -191,22 +191,22 @@ } /** - * Retrieve a list of the most popular terms from the specified taxonomy. + * Retrieves a list of the most popular terms from the specified taxonomy. * - * If the $echo argument is true then the elements for a list of checkbox + * If the `$display` argument is true then the elements for a list of checkbox * `` elements labelled with the names of the selected terms is output. - * If the $post_ID global isn't empty then the terms associated with that + * If the `$post_ID` global is not empty then the terms associated with that * post will be marked as checked. * * @since 2.5.0 * - * @param string $taxonomy Taxonomy to retrieve terms from. - * @param int $default Not used. - * @param int $number Number of terms to retrieve. Defaults to 10. - * @param bool $echo Optionally output the list as well. Defaults to true. + * @param string $taxonomy Taxonomy to retrieve terms from. + * @param int $default_term Optional. Not used. + * @param int $number Optional. Number of terms to retrieve. Default 10. + * @param bool $display Optional. Whether to display the list as well. Default true. * @return int[] Array of popular term IDs. */ -function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) { +function wp_popular_terms_checklist( $taxonomy, $default_term = 0, $number = 10, $display = true ) { $post = get_post(); if ( $post && $post->ID ) { @@ -231,9 +231,11 @@ foreach ( (array) $terms as $term ) { $popular_ids[] = $term->term_id; - if ( ! $echo ) { // Hack for Ajax use. + + if ( ! $display ) { // Hack for Ajax use. continue; } + $id = "popular-$taxonomy-$term->term_id"; $checked = in_array( $term->term_id, $checked_terms, true ) ? 'checked="checked"' : ''; ?> @@ -344,7 +346,11 @@ foreach ( $taxonomy_names as $taxonomy_name ) { $taxonomy = get_taxonomy( $taxonomy_name ); - if ( $taxonomy->hierarchical && $taxonomy->show_ui ) { + if ( ! $taxonomy->show_in_quick_edit ) { + continue; + } + + if ( $taxonomy->hierarchical ) { $terms = get_object_term_cache( $post->ID, $taxonomy_name ); if ( false === $terms ) { @@ -355,7 +361,7 @@ echo '
'; if ( $plugin ) { /* translators: %s: The name of the plugin that generated this meta box. */ - printf( __( "This meta box, from the %s plugin, isn't compatible with the block editor." ), "{$plugin['Name']}" ); + printf( __( 'This meta box, from the %s plugin, is not compatible with the block editor.' ), "{$plugin['Name']}" ); } else { - _e( "This meta box isn't compatible with the block editor." ); + _e( 'This meta box is not compatible with the block editor.' ); } echo '
'; @@ -1170,13 +1176,13 @@ printf( __( 'Please activate the Classic Editor plugin to use this meta box.' ), esc_url( $activate_url ) ); echo ''; } - } elseif ( $object instanceof WP_Post ) { + } elseif ( $data_object instanceof WP_Post ) { $edit_url = add_query_arg( array( 'classic-editor' => '', 'classic-editor__forget' => '', ), - get_edit_post_link( $object ) + get_edit_post_link( $data_object ) ); echo ''; /* translators: %s: A link to use the Classic Editor plugin. */ @@ -1240,17 +1246,17 @@ * * @global array $wp_meta_boxes * - * @param string|WP_Screen $screen The screen identifier. If you have used add_menu_page() or - * add_submenu_page() to create a new screen (and hence screen_id) - * make sure your menu slug conforms to the limits of sanitize_key() - * otherwise the 'screen' menu may not correctly render on your page. - * @param string $context The screen context for which to display meta boxes. - * @param mixed $object Gets passed to the meta box callback function as the first parameter. - * Often this is the object that's the focus of the current screen, for - * example a `WP_Post` or `WP_Comment` object. + * @param string|WP_Screen $screen The screen identifier. If you have used add_menu_page() or + * add_submenu_page() to create a new screen (and hence screen_id) + * make sure your menu slug conforms to the limits of sanitize_key() + * otherwise the 'screen' menu may not correctly render on your page. + * @param string $context The screen context for which to display meta boxes. + * @param mixed $data_object Gets passed to the meta box callback function as the first parameter. + * Often this is the object that's the focus of the current screen, + * for example a `WP_Post` or `WP_Comment` object. * @return int Number of meta_boxes. */ -function do_meta_boxes( $screen, $context, $object ) { +function do_meta_boxes( $screen, $context, $data_object ) { global $wp_meta_boxes; static $already_sorted = false; @@ -1384,7 +1390,7 @@
{$plugin['Name']}" ); + printf( __( 'This meta box, from the %s plugin, is not compatible with the block editor.' ), "{$plugin['Name']}" ); ?>
@@ -1392,7 +1398,7 @@ } } - call_user_func( $box['callback'], $object, $box ); + call_user_func( $box['callback'], $data_object, $box ); echo "\n"; echo "\n"; } @@ -1469,12 +1475,12 @@ * * @uses global $wp_meta_boxes Used to retrieve registered meta boxes. * - * @param string|object $screen The screen identifier. - * @param string $context The screen context for which to display accordion sections. - * @param mixed $object Gets passed to the section callback function as the first parameter. + * @param string|object $screen The screen identifier. + * @param string $context The screen context for which to display accordion sections. + * @param mixed $data_object Gets passed to the section callback function as the first parameter. * @return int Number of meta boxes as accordion sections. */ -function do_accordion_sections( $screen, $context, $object ) { +function do_accordion_sections( $screen, $context, $data_object ) { global $wp_meta_boxes; wp_enqueue_script( 'accordion' ); @@ -1519,7 +1525,7 @@