From fdc2244647a5e866049ee7596715c3313873ecdd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 16 Jun 2021 09:41:44 +0000 Subject: [PATCH] Docs: Update syntax for some multi-line comments per the documentation standards. Follow-up to [51003], [51149]. See #52628. git-svn-id: https://develop.svn.wordpress.org/trunk@51168 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-template.php | 22 ++++++++++++---------- src/wp-includes/class-wp-theme-json.php | 8 +++++--- src/wp-includes/theme-templates.php | 13 +++++++------ 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/wp-includes/block-template.php b/src/wp-includes/block-template.php index 1a879c1670..d185580f01 100644 --- a/src/wp-includes/block-template.php +++ b/src/wp-includes/block-template.php @@ -23,11 +23,14 @@ function locate_block_template( $template, $type, array $templates ) { global $_wp_current_template_content; if ( $template ) { - // locate_template() has found a PHP template at the path specified by $template. - // That means that we have a fallback candidate if we cannot find a block template - // with higher specificity. - // Thus, before looking for matching block themes, we shorten our list of candidate - // templates accordingly. + /* + * locate_template() has found a PHP template at the path specified by $template. + * That means that we have a fallback candidate if we cannot find a block template + * with higher specificity. + * + * Thus, before looking for matching block themes, we shorten our list of candidate + * templates accordingly. + */ // Locate the index of $template (without the theme directory path) in $templates. $relative_template_path = str_replace( @@ -218,11 +221,10 @@ function _strip_template_file_suffix( $template_file ) { */ function _block_template_render_without_post_block_context( $context ) { /* - * When loading a template directly and not through a page - * that resolves it, the top-level post ID and type context get set to that - * of the template. Templates are just the structure of a site, and - * they should not be available as post context because blocks like Post - * Content would recurse infinitely. + * When loading a template directly and not through a page that resolves it, + * the top-level post ID and type context get set to that of the template. + * Templates are just the structure of a site, and they should not be available + * as post context because blocks like Post Content would recurse infinitely. */ if ( isset( $context['postType'] ) && 'wp_template' === $context['postType'] ) { unset( $context['postId'] ); diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index 2293ea5715..99d37acf86 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -1098,9 +1098,11 @@ class WP_Theme_JSON { $incoming_data = $incoming->get_raw_data(); $this->theme_json = array_replace_recursive( $this->theme_json, $incoming_data ); - // The array_replace_recursive algorithm merges at the leaf level. - // For leaf values that are arrays it will use the numeric indexes for replacement. - // In those cases, we want to replace the existing with the incoming value, if it exists. + /* + * The array_replace_recursive() algorithm merges at the leaf level. + * For leaf values that are arrays it will use the numeric indexes for replacement. + * In those cases, we want to replace the existing with the incoming value, if it exists. + */ $to_replace = array(); $to_replace[] = array( 'custom' ); $to_replace[] = array( 'spacing', 'units' ); diff --git a/src/wp-includes/theme-templates.php b/src/wp-includes/theme-templates.php index d380951e38..49f1ce752c 100644 --- a/src/wp-includes/theme-templates.php +++ b/src/wp-includes/theme-templates.php @@ -22,12 +22,13 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID $override_slug = $slug; } - // Template slugs must be unique within the same theme. - // TODO - Figure out how to update this to work for a multi-theme - // environment. Unfortunately using `get_the_terms` for the 'wp-theme' - // term does not work in the case of new entities since is too early in - // the process to have been saved to the entity. So for now we use the - // currently activated theme for creation. + /* + * Template slugs must be unique within the same theme. + * TODO - Figure out how to update this to work for a multi-theme environment. + * Unfortunately using `get_the_terms()` for the 'wp-theme' term does not work + * in the case of new entities since is too early in the process to have been saved + * to the entity. So for now we use the currently activated theme for creation. + */ $theme = wp_get_theme()->get_stylesheet(); $terms = get_the_terms( $post_ID, 'wp_theme' ); if ( $terms && ! is_wp_error( $terms ) ) {