Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

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

    r47018 r47122  
    174174            $home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) );
    175175
    176             // Trim path info from the end and the leading home path from the
    177             // front. For path info requests, this leaves us with the requesting
    178             // filename, if any. For 404 requests, this leaves us with the
    179             // requested permalink.
     176            /*
     177             * Trim path info from the end and the leading home path from the front.
     178             * For path info requests, this leaves us with the requesting filename, if any.
     179             * For 404 requests, this leaves us with the requested permalink.
     180             */
    180181            $req_uri  = str_replace( $pathinfo, '', $req_uri );
    181182            $req_uri  = trim( $req_uri, '/' );
     
    190191
    191192            // The requested permalink is in $pathinfo for path info requests and
    192             //  $req_uri for other requests.
     193            // $req_uri for other requests.
    193194            if ( ! empty( $pathinfo ) && ! preg_match( '|^.*' . $wp_rewrite->index . '$|', $pathinfo ) ) {
    194195                $requested_path = $pathinfo;
     
    207208            $request_match = $requested_path;
    208209            if ( empty( $request_match ) ) {
    209                 // An empty request could only match against ^$ regex
     210                // An empty request could only match against ^$ regex.
    210211                if ( isset( $rewrite['$'] ) ) {
    211212                    $this->matched_rule = '$';
     
    324325        }
    325326
    326         // Convert urldecoded spaces back into +
     327        // Convert urldecoded spaces back into '+'.
    327328        foreach ( get_taxonomies( array(), 'objects' ) as $taxonomy => $t ) {
    328329            if ( $t->query_var && isset( $this->query_vars[ $t->query_var ] ) ) {
     
    344345        }
    345346
    346         // Limit publicly queried post_types to those that are publicly_queryable
     347        // Limit publicly queried post_types to those that are 'publicly_queryable'.
    347348        if ( isset( $this->query_vars['post_type'] ) ) {
    348349            $queryable_post_types = get_post_types( array( 'publicly_queryable' => true ) );
     
    418419            $headers['Content-Type'] = get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' );
    419420        } else {
    420             // Set the correct content type for feeds
     421            // Set the correct content type for feeds.
    421422            $type = $this->query_vars['feed'];
    422423            if ( 'feed' == $this->query_vars['feed'] ) {
     
    453454            $headers['ETag']          = $wp_etag;
    454455
    455             // Support for Conditional GET
     456            // Support for conditional GET.
    456457            if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ) {
    457458                $client_etag = wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] );
     
    461462
    462463            $client_last_modified = empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? '' : trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
    463             // If string is empty, return 0. If not, attempt to parse into a timestamp
     464            // If string is empty, return 0. If not, attempt to parse into a timestamp.
    464465            $client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;
    465466
    466             // Make a timestamp for our most recent modification...
     467            // Make a timestamp for our most recent modification..
    467468            $wp_modified_timestamp = strtotime( $wp_last_modified );
    468469
     
    676677                }
    677678
    678                 // check for paged content that exceeds the max number of pages
     679                // Check for paged content that exceeds the max number of pages.
    679680                $next = '<!--nextpage-->';
    680681                if ( $p && false !== strpos( $p->post_content, $next ) && ! empty( $this->query_vars['page'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.