Make WordPress Core


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

    r47060 r47122  
    2929         */
    3030        public function __construct() {
    31                 // Hack to get the [embed] shortcode to run before wpautop()
     31                // Hack to get the [embed] shortcode to run before wpautop().
    3232                add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 );
    3333                add_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 );
    3434
    35                 // Shortcode placeholder for strip_shortcodes()
     35                // Shortcode placeholder for strip_shortcodes().
    3636                add_shortcode( 'embed', '__return_false' );
    3737
    38                 // Attempts to embed all URLs in a post
     38                // Attempts to embed all URLs in a post.
    3939                add_filter( 'the_content', array( $this, 'autoembed' ), 8 );
    4040                add_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 );
    4141
    42                 // After a post is saved, cache oEmbed items via Ajax
     42                // After a post is saved, cache oEmbed items via Ajax.
    4343                add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) );
    4444                add_action( 'edit_page_form', array( $this, 'maybe_run_ajax_cache' ) );
     
    6060                global $shortcode_tags;
    6161
    62                 // Back up current registered shortcodes and clear them all out
     62                // Back up current registered shortcodes and clear them all out.
    6363                $orig_shortcode_tags = $shortcode_tags;
    6464                remove_all_shortcodes();
     
    6666                add_shortcode( 'embed', array( $this, 'shortcode' ) );
    6767
    68                 // Do the shortcode (only the [embed] one is registered)
     68                // Do the shortcode (only the [embed] one is registered).
    6969                $content = do_shortcode( $content, true );
    7070
    71                 // Put the original shortcodes back
     71                // Put the original shortcodes back.
    7272                $shortcode_tags = $orig_shortcode_tags;
    7373
     
    162162                $this->last_attr = $attr;
    163163
    164                 // kses converts & into & and we need to undo this
     164                // KSES converts & into & and we need to undo this.
    165165                // See https://core.trac.wordpress.org/ticket/11311
    166166                $url = str_replace( '&', '&', $url );
    167167
    168                 // Look for known internal handlers
     168                // Look for known internal handlers.
    169169                ksort( $this->handlers );
    170170                foreach ( $this->handlers as $priority => $handlers ) {
     
    340340                }
    341341
    342                 // Still unknown
     342                // Still unknown.
    343343                return $this->maybe_make_link( $url );
    344344        }
     
    382382                }
    383383
    384                 // Trigger a caching
     384                // Trigger a caching.
    385385                if ( ! empty( $post->post_content ) ) {
    386386                        $this->post_ID  = $post->ID;
     
    487487
    488488                if ( ! empty( $oembed_post_query->posts ) ) {
    489                         // Note: 'fields'=>'ids' is not being used in order to cache the post object as it will be needed.
     489                        // Note: 'fields' => 'ids' is not being used in order to cache the post object as it will be needed.
    490490                        $oembed_post_id = $oembed_post_query->posts[0]->ID;
    491491                        wp_cache_set( $cache_key, $oembed_post_id, $cache_group );
Note: See TracChangeset for help on using the changeset viewer.