Embeds: Cache oEmbeds in an oembed_cache custom post type instead of postmeta when there is no global $post.

Add processing of embeds to rich Text widget.

Props swissspidy, westonruter, ocean90, johnbillion.
See #40854, #39994, #40935.
Fixes #34115.


git-svn-id: https://develop.svn.wordpress.org/trunk@41651 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2017-09-30 01:14:34 +00:00
parent 743494b654
commit 6e74a9bf23
4 changed files with 230 additions and 76 deletions
+3 -3
View File
@@ -35,12 +35,12 @@ class Tests_External_HTTP_OEmbed extends WP_UnitTestCase {
function test_youtube_embed_url() {
global $wp_embed;
$out = $wp_embed->autoembed( 'https://www.youtube.com/embed/QcIy9NiNbmo' );
$this->assertContains( 'https://youtube.com/watch?v=QcIy9NiNbmo', $out );
$this->assertContains( 'https://www.youtube.com/embed/QcIy9NiNbmo?feature=oembed', $out );
}
function test_youtube_v_url() {
global $wp_embed;
$out = $wp_embed->autoembed( 'https://www.youtube.com/v/QcIy9NiNbmo' );
$this->assertContains( 'https://youtube.com/watch?v=QcIy9NiNbmo', $out );
$this->assertContains( 'https://www.youtube.com/embed/QcIy9NiNbmo?feature=oembed', $out );
}
}
}