Docs: Replace multiple single line comments with multi-line comments.

This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments.

Follow-up to [56174], [56175], [56176], [56177], [56178], [56179], [56180], [56191], [56192], [56193].

Props costdev, audrasjb.
See #58459.



Built from https://develop.svn.wordpress.org/trunk@56194


git-svn-id: http://core.svn.wordpress.org/trunk@55706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb
2023-07-10 23:11:22 +00:00
parent 55b31a92be
commit b89f155a10
10 changed files with 141 additions and 73 deletions

View File

@@ -45,8 +45,10 @@ function wp_get_themes( $args = array() ) {
$theme_directories = search_theme_directories();
if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) {
// Make sure the active theme wins out, in case search_theme_directories() picks the wrong
// one in the case of a conflict. (Normally, last registered theme root wins.)
/*
* Make sure the active theme wins out, in case search_theme_directories() picks the wrong
* one in the case of a conflict. (Normally, last registered theme root wins.)
*/
$current_theme = get_stylesheet();
if ( isset( $theme_directories[ $current_theme ] ) ) {
$root_of_current_theme = get_raw_theme_root( $current_theme );
@@ -510,16 +512,20 @@ function search_theme_directories( $force = false ) {
continue;
}
if ( file_exists( $theme_root . '/' . $dir . '/style.css' ) ) {
// wp-content/themes/a-single-theme
// wp-content/themes is $theme_root, a-single-theme is $dir.
/*
* wp-content/themes/a-single-theme
* wp-content/themes is $theme_root, a-single-theme is $dir.
*/
$found_themes[ $dir ] = array(
'theme_file' => $dir . '/style.css',
'theme_root' => $theme_root,
);
} else {
$found_theme = false;
// wp-content/themes/a-folder-of-themes/*
// wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs.
/*
* wp-content/themes/a-folder-of-themes/*
* wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs.
*/
$sub_dirs = @ scandir( $theme_root . '/' . $dir );
if ( ! $sub_dirs ) {
trigger_error( "$theme_root/$dir is not readable", E_USER_NOTICE );
@@ -538,8 +544,10 @@ function search_theme_directories( $force = false ) {
);
$found_theme = true;
}
// Never mind the above, it's just a theme missing a style.css.
// Return it; WP_Theme will catch the error.
/*
* Never mind the above, it's just a theme missing a style.css.
* Return it; WP_Theme will catch the error.
*/
if ( ! $found_theme ) {
$found_themes[ $dir ] = array(
'theme_file' => $dir . '/style.css',
@@ -587,8 +595,10 @@ function get_theme_root( $stylesheet_or_template = '' ) {
if ( $stylesheet_or_template ) {
$theme_root = get_raw_theme_root( $stylesheet_or_template );
if ( $theme_root ) {
// Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory.
// This gives relative theme roots the benefit of the doubt when things go haywire.
/*
* Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory.
* This gives relative theme roots the benefit of the doubt when things go haywire.
*/
if ( ! in_array( $theme_root, (array) $wp_theme_directories, true ) ) {
$theme_root = WP_CONTENT_DIR . $theme_root;
}
@@ -1832,8 +1842,10 @@ function _custom_background_cb() {
// $background is the saved custom image, or the default image.
$background = set_url_scheme( get_background_image() );
// $color is the saved custom color.
// A default has to be specified in style.css. It will not be printed here.
/*
* $color is the saved custom color.
* A default has to be specified in style.css. It will not be printed here.
*/
$color = get_background_color();
if ( get_theme_support( 'custom-background', 'default-color' ) === $color ) {
@@ -2507,8 +2519,10 @@ function get_theme_starter_content() {
}
break;
// All that's left now are posts (besides attachments).
// Not a default case for the sake of clarity and future work.
/*
* All that's left now are posts (besides attachments).
* Not a default case for the sake of clarity and future work.
*/
case 'posts':
foreach ( $config[ $type ] as $id => $item ) {
if ( is_array( $item ) ) {
@@ -2735,14 +2749,18 @@ function add_theme_support( $feature, ...$args ) {
$jit = isset( $args[0]['__jit'] );
unset( $args[0]['__jit'] );
// Merge in data from previous add_theme_support() calls.
// The first value registered wins. (A child theme is set up first.)
/*
* Merge in data from previous add_theme_support() calls.
* The first value registered wins. (A child theme is set up first.)
*/
if ( isset( $_wp_theme_features['custom-header'] ) ) {
$args[0] = wp_parse_args( $_wp_theme_features['custom-header'][0], $args[0] );
}
// Load in the defaults at the end, as we need to insure first one wins.
// This will cause all constants to be defined, as each arg will then be set to the default.
/*
* Load in the defaults at the end, as we need to insure first one wins.
* This will cause all constants to be defined, as each arg will then be set to the default.
*/
if ( $jit ) {
$args[0] = wp_parse_args( $args[0], $defaults );
}
@@ -2789,8 +2807,10 @@ function add_theme_support( $feature, ...$args ) {
$args[0]['random-default'] = false;
}
// If headers are supported, and we still don't have a defined width or height,
// we have implicit flex sizes.
/*
* If headers are supported, and we still don't have a defined width or height,
* we have implicit flex sizes.
*/
if ( $jit ) {
if ( empty( $args[0]['width'] ) && empty( $args[0]['flex-width'] ) ) {
$args[0]['flex-width'] = true;
@@ -3487,12 +3507,16 @@ function _wp_customize_include() {
$autosaved = null;
$messenger_channel = null;
// Value false indicates UUID should be determined after_setup_theme
// to either re-use existing saved changeset or else generate a new UUID if none exists.
/*
* Value false indicates UUID should be determined after_setup_theme
* to either re-use existing saved changeset or else generate a new UUID if none exists.
*/
$changeset_uuid = false;
// Set initially fo false since defaults to true for back-compat;
// can be overridden via the customize_changeset_branching filter.
/*
* Set initially fo false since defaults to true for back-compat;
* can be overridden via the customize_changeset_branching filter.
*/
$branching = false;
if ( $is_customize_admin_page && isset( $input_vars['changeset_uuid'] ) ) {