Changeset 47122 for trunk/src/wp-includes/class-wp-embed.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-embed.php
r47060 r47122 29 29 */ 30 30 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(). 32 32 add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 ); 33 33 add_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 ); 34 34 35 // Shortcode placeholder for strip_shortcodes() 35 // Shortcode placeholder for strip_shortcodes(). 36 36 add_shortcode( 'embed', '__return_false' ); 37 37 38 // Attempts to embed all URLs in a post 38 // Attempts to embed all URLs in a post. 39 39 add_filter( 'the_content', array( $this, 'autoembed' ), 8 ); 40 40 add_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 ); 41 41 42 // After a post is saved, cache oEmbed items via Ajax 42 // After a post is saved, cache oEmbed items via Ajax. 43 43 add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) ); 44 44 add_action( 'edit_page_form', array( $this, 'maybe_run_ajax_cache' ) ); … … 60 60 global $shortcode_tags; 61 61 62 // Back up current registered shortcodes and clear them all out 62 // Back up current registered shortcodes and clear them all out. 63 63 $orig_shortcode_tags = $shortcode_tags; 64 64 remove_all_shortcodes(); … … 66 66 add_shortcode( 'embed', array( $this, 'shortcode' ) ); 67 67 68 // Do the shortcode (only the [embed] one is registered) 68 // Do the shortcode (only the [embed] one is registered). 69 69 $content = do_shortcode( $content, true ); 70 70 71 // Put the original shortcodes back 71 // Put the original shortcodes back. 72 72 $shortcode_tags = $orig_shortcode_tags; 73 73 … … 162 162 $this->last_attr = $attr; 163 163 164 // kses converts & into & and we need to undo this164 // KSES converts & into & and we need to undo this. 165 165 // See https://core.trac.wordpress.org/ticket/11311 166 166 $url = str_replace( '&', '&', $url ); 167 167 168 // Look for known internal handlers 168 // Look for known internal handlers. 169 169 ksort( $this->handlers ); 170 170 foreach ( $this->handlers as $priority => $handlers ) { … … 340 340 } 341 341 342 // Still unknown 342 // Still unknown. 343 343 return $this->maybe_make_link( $url ); 344 344 } … … 382 382 } 383 383 384 // Trigger a caching 384 // Trigger a caching. 385 385 if ( ! empty( $post->post_content ) ) { 386 386 $this->post_ID = $post->ID; … … 487 487 488 488 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. 490 490 $oembed_post_id = $oembed_post_query->posts[0]->ID; 491 491 wp_cache_set( $cache_key, $oembed_post_id, $cache_group );
Note: See TracChangeset
for help on using the changeset viewer.