Make WordPress Core

Changeset 52352


Ignore:
Timestamp:
12/10/2021 08:28:27 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Correct the format of some comments per the documentation standards.

Follow-up to [10357], [10939], [43309], [51003], [51266], [51653], [51738], [52110].

See #53399.

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r52227 r52352  
    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'],
     
    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'],
     
    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']
  • trunk/src/wp-admin/index.php

    r47198 r52352  
    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,
  • trunk/src/wp-admin/load-scripts.php

    r52087 r52352  
    11<?php
    22
    3 /**
     3/*
    44 * Disable error reporting
    55 *
     
    88error_reporting( 0 );
    99
    10 /** Set ABSPATH for execution */
     10// Set ABSPATH for execution.
    1111if ( ! defined( 'ABSPATH' ) ) {
    1212        define( 'ABSPATH', dirname( __DIR__ ) . '/' );
  • trunk/src/wp-admin/load-styles.php

    r52087 r52352  
    11<?php
    22
    3 /**
     3/*
    44 * Disable error reporting
    55 *
     
    88error_reporting( 0 );
    99
    10 /** Set ABSPATH for execution */
     10// Set ABSPATH for execution.
    1111if ( ! defined( 'ABSPATH' ) ) {
    1212        define( 'ABSPATH', dirname( __DIR__ ) . '/' );
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r52332 r52352  
    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 );
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r51791 r52352  
    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'] );
  • trunk/src/wp-includes/default-filters.php

    r52316 r52352  
    675675add_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.
    678678add_filter( 'render_block_context', '_block_template_render_without_post_block_context' );
    679679add_filter( 'pre_wp_unique_post_slug', 'wp_filter_wp_template_unique_post_slug', 10, 5 );
  • trunk/src/wp-includes/functions.php

    r52215 r52352  
    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'];
     
    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
     
    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
     
    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();
     
    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
     
    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;
     
    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 */
     
    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
     
    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;
  • trunk/src/wp-includes/load.php

    r52144 r52352  
    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.
     
    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
  • trunk/src/wp-includes/template-canvas.php

    r52069 r52352  
    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().
  • trunk/src/wp-includes/user.php

    r52076 r52352  
    21592159         *
    21602160         * @since 4.9.0
    2161          * @since 5.8.0 The $userdata parameter was added.
     2161         * @since 5.8.0 The `$userdata` parameter was added.
    21622162         *
    21632163         * @param array    $data {
     
    22042204         *
    22052205         * @since 4.4.0
    2206          * @since 5.8.0 The $userdata parameter was added.
     2206         * @since 5.8.0 The `$userdata` parameter was added.
    22072207         *
    22082208         * @param array $meta {
     
    22752275                 *
    22762276                 * @since 2.0.0
    2277                  * @since 5.8.0 The $userdata parameter was added.
     2277                 * @since 5.8.0 The `$userdata` parameter was added.
    22782278                 *
    22792279                 * @param int     $user_id       User ID.
     
    23092309                 *
    23102310                 * @since 1.5.0
    2311                  * @since 5.8.0 The $userdata parameter was added.
     2311                 * @since 5.8.0 The `$userdata` parameter was added.
    23122312                 *
    23132313                 * @param int   $user_id  User ID.
  • trunk/tests/phpunit/data/widgets/custom-widget-classes.php

    r50953 r52352  
    22namespace Test\Sub\Sub {
    33
    4         class Namespaced_Widget extends \WP_Widget {
    5         }
     4        class Namespaced_Widget extends \WP_Widget {}
    65
    76}
     
    98namespace {
    109
    11         class Non_Namespaced_Widget extends \WP_Widget {
    12         }
     10        class Non_Namespaced_Widget extends \WP_Widget {}
    1311
    1412}
  • trunk/tests/phpunit/tests/option/sanitize-option.php

    r52294 r52352  
    156156                        array( '/%year%/%monthnum%/%day%/%postname%/', '/%year%/%monthnum%/%day%/%postname%/', true ),
    157157                        array( '/%year/%postname%/', '/%year/%postname%/', true ),
    158                         array( new WP_Error( 'wpdb_get_table_charset_failure' ), false, false ), // ticket 53986
     158                        array( new WP_Error( 'wpdb_get_table_charset_failure' ), false, false ), // @ticket 53986
    159159                );
    160160        }
  • trunk/tests/phpunit/tests/user.php

    r52010 r52352  
    19101910         */
    19111911        public function filter_custom_meta( $meta_input ) {
    1912                 // Update some meta inputs
     1912                // Update some meta inputs.
    19131913                $meta_input['test_meta_key'] = 'update_from_filter';
    1914                 // Add a new meta
     1914                // Add a new meta.
    19151915                $meta_input['new_meta_from_filter'] = 'new_from_filter';
    19161916
Note: See TracChangeset for help on using the changeset viewer.