Skip to content

Commit 882687a

Browse files
Docs: Correct the format of some comments per the documentation standards.
Follow-up to [10357], [10939], [43309], [51003], [51266], [51653], [51738], [52110]. See #53399. git-svn-id: https://develop.svn.wordpress.org/trunk@52352 602fd350-edb4-49c9-b593-d223f7449a82
1 parent db30405 commit 882687a

14 files changed

Lines changed: 84 additions & 50 deletions

src/wp-admin/includes/plugin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,7 +2523,7 @@ function deactivated_plugins_notice() {
25232523
foreach ( $deactivated_plugins as $plugin ) {
25242524
if ( ! empty( $plugin['version_compatible'] ) && ! empty( $plugin['version_deactivated'] ) ) {
25252525
$explanation = sprintf(
2526-
/* translators: 1: Name of deactivated plugin, 2: Plugin version deactivated, 3: Current WP version, 4: Compatible plugin version */
2526+
/* translators: 1: Name of deactivated plugin, 2: Plugin version deactivated, 3: Current WP version, 4: Compatible plugin version. */
25272527
__( '%1$s %2$s was deactivated due to incompatibility with WordPress %3$s, please upgrade to %1$s %4$s or later.' ),
25282528
$plugin['plugin_name'],
25292529
$plugin['version_deactivated'],
@@ -2532,7 +2532,7 @@ function deactivated_plugins_notice() {
25322532
);
25332533
} else {
25342534
$explanation = sprintf(
2535-
/* translators: 1: Name of deactivated plugin, 2: Plugin version deactivated, 3: Current WP version */
2535+
/* translators: 1: Name of deactivated plugin, 2: Plugin version deactivated, 3: Current WP version. */
25362536
__( '%1$s %2$s was deactivated due to incompatibility with WordPress %3$s.' ),
25372537
$plugin['plugin_name'],
25382538
! empty( $plugin['version_deactivated'] ) ? $plugin['version_deactivated'] : '',
@@ -2544,7 +2544,7 @@ function deactivated_plugins_notice() {
25442544
printf(
25452545
'<div class="notice notice-warning"><p><strong>%s</strong><br>%s</p><p><a href="%s">%s</a></p></div>',
25462546
sprintf(
2547-
/* translators: %s: Name of deactivated plugin */
2547+
/* translators: %s: Name of deactivated plugin. */
25482548
__( '%s plugin deactivated during WordPress upgrade.' ),
25492549
$plugin['plugin_name']
25502550
),

src/wp-admin/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
/**
3+
/*
44
* Note: this file exists only to remind developers to build the assets.
55
* For the real wp-admin/index.php that gets built and boots WordPress,
66
* please refer to wp-admin/_index.php.

src/wp-admin/load-scripts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
/**
3+
/*
44
* Disable error reporting
55
*
66
* Set this to error_reporting( -1 ) for debugging.
77
*/
88
error_reporting( 0 );
99

10-
/** Set ABSPATH for execution */
10+
// Set ABSPATH for execution.
1111
if ( ! defined( 'ABSPATH' ) ) {
1212
define( 'ABSPATH', dirname( __DIR__ ) . '/' );
1313
}

src/wp-admin/load-styles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
/**
3+
/*
44
* Disable error reporting
55
*
66
* Set this to error_reporting( -1 ) for debugging
77
*/
88
error_reporting( 0 );
99

10-
/** Set ABSPATH for execution */
10+
// Set ABSPATH for execution.
1111
if ( ! defined( 'ABSPATH' ) ) {
1212
define( 'ABSPATH', dirname( __DIR__ ) . '/' );
1313
}

src/wp-includes/class-wp-customize-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public function __construct( $args = array() ) {
346346
* @see WP_Customize_Manager::__construct()
347347
*
348348
* @param string[] $components Array of core components to load.
349-
* @param WP_Customize_Manager $manager WP_Customize_Manager instance.
349+
* @param WP_Customize_Manager $manager WP_Customize_Manager instance.
350350
*/
351351
$components = apply_filters( 'customize_loaded_components', $this->components, $this );
352352

src/wp-includes/class-wp-customize-widgets.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,9 +1421,8 @@ public function sanitize_widget_instance( $value, $id_base = null ) {
14211421
if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) {
14221422
if ( 'block' === $id_base && ! current_user_can( 'unfiltered_html' ) ) {
14231423
/*
1424-
* The content of the 'block' widget is not filtered on the
1425-
* fly while editing. Filter the content here to prevent
1426-
* vulnerabilities.
1424+
* The content of the 'block' widget is not filtered on the fly while editing.
1425+
* Filter the content here to prevent vulnerabilities.
14271426
*/
14281427
$value['raw_instance']['content'] = wp_kses_post( $value['raw_instance']['content'] );
14291428
}

src/wp-includes/default-filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@
674674
add_filter( 'user_has_cap', 'wp_maybe_grant_resume_extensions_caps', 1 );
675675
add_filter( 'user_has_cap', 'wp_maybe_grant_site_health_caps', 1, 4 );
676676

677-
// Block Templates post type and Rendering
677+
// Block templates post type and rendering.
678678
add_filter( 'render_block_context', '_block_template_render_without_post_block_context' );
679679
add_filter( 'pre_wp_unique_post_slug', 'wp_filter_wp_template_unique_post_slug', 10, 5 );
680680
add_action( 'save_post_wp_template_part', 'wp_set_unique_slug_on_create_template_part' );

src/wp-includes/functions.php

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,8 +2538,10 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
25382538
$filename = str_replace( "{$fname}{$ext}", "{$fname}-{$number}{$ext}", $filename );
25392539
}
25402540

2541-
// Get the mime type. Uploaded files were already checked with wp_check_filetype_and_ext()
2542-
// in _wp_handle_upload(). Using wp_check_filetype() would be sufficient here.
2541+
/*
2542+
* Get the mime type. Uploaded files were already checked with wp_check_filetype_and_ext()
2543+
* in _wp_handle_upload(). Using wp_check_filetype() would be sufficient here.
2544+
*/
25432545
$file_type = wp_check_filetype( $filename );
25442546
$mime_type = $file_type['type'];
25452547

@@ -2550,27 +2552,40 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
25502552
$lc_ext = strtolower( $ext );
25512553
$_dir = trailingslashit( $dir );
25522554

2553-
// If the extension is uppercase add an alternate file name with lowercase extension. Both need to be tested
2554-
// for uniqueness as the extension will be changed to lowercase for better compatibility with different filesystems.
2555-
// Fixes an inconsistency in WP < 2.9 where uppercase extensions were allowed but image sub-sizes were created with
2556-
// lowercase extensions.
2555+
/*
2556+
* If the extension is uppercase add an alternate file name with lowercase extension.
2557+
* Both need to be tested for uniqueness as the extension will be changed to lowercase
2558+
* for better compatibility with different filesystems. Fixes an inconsistency in WP < 2.9
2559+
* where uppercase extensions were allowed but image sub-sizes were created with
2560+
* lowercase extensions.
2561+
*/
25572562
if ( $ext && $lc_ext !== $ext ) {
25582563
$lc_filename = preg_replace( '|' . preg_quote( $ext ) . '$|', $lc_ext, $filename );
25592564
}
25602565

2561-
// Increment the number added to the file name if there are any files in $dir whose names match one of the
2562-
// possible name variations.
2566+
/*
2567+
* Increment the number added to the file name if there are any files in $dir
2568+
* whose names match one of the possible name variations.
2569+
*/
25632570
while ( file_exists( $_dir . $filename ) || ( $lc_filename && file_exists( $_dir . $lc_filename ) ) ) {
25642571
$new_number = (int) $number + 1;
25652572

25662573
if ( $lc_filename ) {
2567-
$lc_filename = str_replace( array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ), "-{$new_number}{$lc_ext}", $lc_filename );
2574+
$lc_filename = str_replace(
2575+
array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ),
2576+
"-{$new_number}{$lc_ext}",
2577+
$lc_filename
2578+
);
25682579
}
25692580

25702581
if ( '' === "{$number}{$ext}" ) {
25712582
$filename = "{$filename}-{$new_number}";
25722583
} else {
2573-
$filename = str_replace( array( "-{$number}{$ext}", "{$number}{$ext}" ), "-{$new_number}{$ext}", $filename );
2584+
$filename = str_replace(
2585+
array( "-{$number}{$ext}", "{$number}{$ext}" ),
2586+
"-{$new_number}{$ext}",
2587+
$filename
2588+
);
25742589
}
25752590

25762591
$number = $new_number;
@@ -2581,8 +2596,10 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
25812596
$filename = $lc_filename;
25822597
}
25832598

2584-
// Prevent collisions with existing file names that contain dimension-like strings
2585-
// (whether they are subsizes or originals uploaded prior to #42437).
2599+
/*
2600+
* Prevent collisions with existing file names that contain dimension-like strings
2601+
* (whether they are subsizes or originals uploaded prior to #42437).
2602+
*/
25862603

25872604
$files = array();
25882605
$count = 10000;
@@ -2617,24 +2634,32 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
26172634
if ( ! empty( $files ) ) {
26182635
$count = count( $files );
26192636

2620-
// Ensure this never goes into infinite loop
2621-
// as it uses pathinfo() and regex in the check, but string replacement for the changes.
2637+
/*
2638+
* Ensure this never goes into infinite loop as it uses pathinfo() and regex in the check,
2639+
* but string replacement for the changes.
2640+
*/
26222641
$i = 0;
26232642

26242643
while ( $i <= $count && _wp_check_existing_file_names( $filename, $files ) ) {
26252644
$new_number = (int) $number + 1;
26262645

26272646
// If $ext is uppercase it was replaced with the lowercase version after the previous loop.
2628-
$filename = str_replace( array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ), "-{$new_number}{$lc_ext}", $filename );
2647+
$filename = str_replace(
2648+
array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ),
2649+
"-{$new_number}{$lc_ext}",
2650+
$filename
2651+
);
26292652

26302653
$number = $new_number;
26312654
$i++;
26322655
}
26332656
}
26342657
}
26352658

2636-
// Check if an image will be converted after uploading or some existing images sub-sizes file names may conflict
2637-
// when regenerated. If yes, ensure the new file name will be unique and will produce unique sub-sizes.
2659+
/*
2660+
* Check if an image will be converted after uploading or some existing image sub-size file names may conflict
2661+
* when regenerated. If yes, ensure the new file name will be unique and will produce unique sub-sizes.
2662+
*/
26382663
if ( $is_image ) {
26392664
/** This filter is documented in wp-includes/class-wp-image-editor.php */
26402665
$output_formats = apply_filters( 'image_editor_output_format', array(), $_dir . $filename, $mime_type );
@@ -2668,8 +2693,10 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
26682693
}
26692694

26702695
if ( ! empty( $alt_filenames ) ) {
2671-
// Add the original filename. It needs to be checked again together with the alternate filenames
2672-
// when $number is incremented.
2696+
/*
2697+
* Add the original filename. It needs to be checked again
2698+
* together with the alternate filenames when $number is incremented.
2699+
*/
26732700
$alt_filenames[ $lc_ext ] = $filename;
26742701

26752702
// Ensure no infinite loop.
@@ -2679,12 +2706,22 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
26792706
$new_number = (int) $number + 1;
26802707

26812708
foreach ( $alt_filenames as $alt_ext => $alt_filename ) {
2682-
$alt_filenames[ $alt_ext ] = str_replace( array( "-{$number}{$alt_ext}", "{$number}{$alt_ext}" ), "-{$new_number}{$alt_ext}", $alt_filename );
2709+
$alt_filenames[ $alt_ext ] = str_replace(
2710+
array( "-{$number}{$alt_ext}", "{$number}{$alt_ext}" ),
2711+
"-{$new_number}{$alt_ext}",
2712+
$alt_filename
2713+
);
26832714
}
26842715

2685-
// Also update the $number in (the output) $filename.
2686-
// If the extension was uppercase it was already replaced with the lowercase version.
2687-
$filename = str_replace( array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ), "-{$new_number}{$lc_ext}", $filename );
2716+
/*
2717+
* Also update the $number in (the output) $filename.
2718+
* If the extension was uppercase it was already replaced with the lowercase version.
2719+
*/
2720+
$filename = str_replace(
2721+
array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ),
2722+
"-{$new_number}{$lc_ext}",
2723+
$filename
2724+
);
26882725

26892726
$number = $new_number;
26902727
$i++;

src/wp-includes/load.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ function wp_debug_mode() {
426426
* Filters whether to allow the debug mode check to occur.
427427
*
428428
* This filter runs before it can be used by plugins. It is designed for
429-
* non-web run-times. Returning false causes the `WP_DEBUG` and related
429+
* non-web runtimes. Returning false causes the `WP_DEBUG` and related
430430
* constants to not be checked and the default PHP values for errors
431431
* will be used unless you take care to update them yourself.
432432
*
@@ -673,7 +673,7 @@ function wp_start_object_cache() {
673673
* Filters whether to enable loading of the object-cache.php drop-in.
674674
*
675675
* This filter runs before it can be used by plugins. It is designed for non-web
676-
* run-times. If false is returned, object-cache.php will never be loaded.
676+
* runtimes. If false is returned, object-cache.php will never be loaded.
677677
*
678678
* @since 5.8.0
679679
*

src/wp-includes/template-canvas.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @package WordPress
66
*/
77

8-
/**
8+
/*
99
* Get the template HTML.
1010
* This needs to run before <head> so that blocks can add scripts and styles in wp_head().
1111
*/

0 commit comments

Comments
 (0)