Docs: Update syntax for some multi-line comments per the documentation standards.

Follow-up to [51003], [51149].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51168


git-svn-id: http://core.svn.wordpress.org/trunk@50777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-06-16 09:42:56 +00:00
parent 5ffd5d6e9b
commit b27fbee0f3
4 changed files with 25 additions and 20 deletions

View File

@ -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'] );

View File

@ -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' );

View File

@ -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 ) ) {

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-beta2-51167';
$wp_version = '5.8-beta2-51168';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.