X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/dc1231b7312fbdca99e9e887cc2bb35a28f85cdc..refs/tags/wordpress-4.4:/wp-includes/class-wp-embed.php
diff --git a/wp-includes/class-wp-embed.php b/wp-includes/class-wp-embed.php
index 74051970..730fc4fc 100644
--- a/wp-includes/class-wp-embed.php
+++ b/wp-includes/class-wp-embed.php
@@ -35,6 +35,7 @@ class WP_Embed {
// After a post is saved, cache oEmbed items via AJAX
add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) );
+ add_action( 'edit_page_form', array( $this, 'maybe_run_ajax_cache' ) );
}
/**
@@ -232,12 +233,13 @@ class WP_Embed {
* Filter whether to inspect the given URL for discoverable link tags.
*
* @since 2.9.0
+ * @since 4.4.0 The default value changed to true.
*
* @see WP_oEmbed::discover()
*
- * @param bool $enable Whether to enable `` tag discovery. Default false.
+ * @param bool $enable Whether to enable `` tag discovery. Default true.
*/
- $attr['discover'] = ( apply_filters( 'embed_oembed_discover', false ) && author_can( $post_ID, 'unfiltered_html' ) );
+ $attr['discover'] = ( apply_filters( 'embed_oembed_discover', true ) );
// Use oEmbed to get the HTML
$html = wp_oembed_get( $url, $attr );
@@ -271,7 +273,7 @@ class WP_Embed {
if ( empty($post_metas) )
return;
- foreach( $post_metas as $post_meta_key ) {
+ foreach ( $post_metas as $post_meta_key ) {
if ( '_oembed_' == substr( $post_meta_key, 0, 8 ) )
delete_post_meta( $post_ID, $post_meta_key );
}