Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 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-oembed.php

    r47101 r47122  
    263263            list( $providerurl, $regex ) = $data;
    264264
    265             // Turn the asterisk-type provider URLs into regex
     265            // Turn the asterisk-type provider URLs into regex.
    266266            if ( ! $regex ) {
    267267                $matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
     
    270270
    271271            if ( preg_match( $matchmask, $url ) ) {
    272                 $provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML
     272                $provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML.
    273273                break;
    274274            }
     
    440440        $args = apply_filters( 'oembed_remote_get_args', $args, $url );
    441441
    442         // Fetch URL content
     442        // Fetch URL content.
    443443        $request = wp_safe_remote_get( $url, $args );
    444444        $html    = wp_remote_retrieve_body( $request );
     
    463463            );
    464464
    465             // Strip <body>
     465            // Strip <body>.
    466466            $html_head_end = stripos( $html, '</head>' );
    467467            if ( $html_head_end ) {
     
    469469            }
    470470
    471             // Do a quick check
     471            // Do a quick check.
    472472            $tagfound = false;
    473473            foreach ( $linktypes as $linktype => $format ) {
     
    485485                        $providers[ $linktypes[ $atts['type'] ] ] = htmlspecialchars_decode( $atts['href'] );
    486486
    487                         // Stop here if it's JSON (that's all we need)
     487                        // Stop here if it's JSON (that's all we need).
    488488                        if ( 'json' == $linktypes[ $atts['type'] ] ) {
    489489                            break;
     
    494494        }
    495495
    496         // JSON is preferred to XML
     496        // JSON is preferred to XML.
    497497        if ( ! empty( $providers['json'] ) ) {
    498498            return $providers['json'];
Note: See TracChangeset for help on using the changeset viewer.