Make WordPress Core


Ignore:
Timestamp:
07/10/2023 10:46:22 PM (14 months ago)
Author:
audrasjb
Message:

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].

Props costdev, audrasjb.
See #58459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r56082 r56192  
    474474    } else {
    475475        $url = trailingslashit( get_home_url( $blog_id, '', $scheme ) );
    476         // nginx only allows HTTP/1.0 methods when redirecting from / to /index.php.
    477         // To work around this, we manually add index.php to the URL, avoiding the redirect.
     476        /*
     477         * nginx only allows HTTP/1.0 methods when redirecting from / to /index.php.
     478         * To work around this, we manually add index.php to the URL, avoiding the redirect.
     479         */
    478480        if ( ! str_ends_with( $url, 'index.php' ) ) {
    479481            $url .= 'index.php';
     
    633635    }
    634636
    635     // While WP_HTTP_Response is the base class of WP_REST_Response, it doesn't provide
    636     // all the required methods used in WP_REST_Server::dispatch().
     637    /*
     638     * While WP_HTTP_Response is the base class of WP_REST_Response, it doesn't provide
     639     * all the required methods used in WP_REST_Server::dispatch().
     640     */
    637641    if ( $response instanceof WP_HTTP_Response ) {
    638642        return new WP_REST_Response(
     
    946950
    947951    foreach ( $fields as $accepted_field ) {
    948         // Check to see if $field is the parent of any item in $fields.
    949         // A field "parent" should be accepted if "parent.child" is accepted.
     952        /*
     953         * Check to see if $field is the parent of any item in $fields.
     954         * A field "parent" should be accepted if "parent.child" is accepted.
     955         */
    950956        if ( str_starts_with( $accepted_field, "$field." ) ) {
    951957            return true;
    952958        }
    953         // Conversely, if "parent" is accepted, all "parent.child" fields
    954         // should also be accepted.
     959        /*
     960         * Conversely, if "parent" is accepted, all "parent.child" fields
     961         * should also be accepted.
     962         */
    955963        if ( str_starts_with( $field, "$accepted_field." ) ) {
    956964            return true;
     
    16101618    );
    16111619
    1612     // Both arrays and objects allow empty strings to be converted to their types.
    1613     // But the best answer for this type is a string.
     1620    /*
     1621     * Both arrays and objects allow empty strings to be converted to their types.
     1622     * But the best answer for this type is a string.
     1623     */
    16141624    if ( '' === $value && in_array( 'string', $types, true ) ) {
    16151625        return 'string';
     
    21922202    }
    21932203
    2194     // The "format" keyword should only be applied to strings. However, for backward compatibility,
    2195     // we allow the "format" keyword if the type keyword was not specified, or was set to an invalid value.
     2204    /*
     2205     * The "format" keyword should only be applied to strings. However, for backward compatibility,
     2206     * we allow the "format" keyword if the type keyword was not specified, or was set to an invalid value.
     2207     */
    21962208    if ( isset( $args['format'] )
    21972209        && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) )
     
    28592871 */
    28602872function rest_preload_api_request( $memo, $path ) {
    2861     // array_reduce() doesn't support passing an array in PHP 5.2,
    2862     // so we need to make sure we start with one.
     2873    /*
     2874     * array_reduce() doesn't support passing an array in PHP 5.2,
     2875     * so we need to make sure we start with one.
     2876     */
    28632877    if ( ! is_array( $memo ) ) {
    28642878        $memo = array();
Note: See TracChangeset for help on using the changeset viewer.