mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Allow inline editing of width and height parameters while previewing an embed in the media modal:
* Use `wp.shortcode()` instead of manually constructing a shortcode in `views/embed/link` * Allow a URL to transition to a shortcode (and vice versa) when returning an embed to TinyMCE * In `WP_Embed`, store the last URL and last set of attributes requested in class properties * `wp_ajax_parse_embed()`, allow `[embed]`s to have attributes. Return `attr` in the response. This is a first pass to allow broad testing with recent MCE view changes. See #31139. git-svn-id: https://develop.svn.wordpress.org/trunk@31620 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -11,6 +11,8 @@ class WP_Embed {
|
||||
public $post_ID;
|
||||
public $usecache = true;
|
||||
public $linkifunknown = true;
|
||||
public $last_attr = array();
|
||||
public $last_url = '';
|
||||
|
||||
/**
|
||||
* When an URL cannot be embedded, return false instead of returning a link
|
||||
@@ -134,12 +136,18 @@ class WP_Embed {
|
||||
$url = $attr['src'];
|
||||
}
|
||||
|
||||
if ( empty( $url ) )
|
||||
$this->last_url = $url;
|
||||
|
||||
if ( empty( $url ) ) {
|
||||
$this->last_attr = $attr;
|
||||
return '';
|
||||
}
|
||||
|
||||
$rawattr = $attr;
|
||||
$attr = wp_parse_args( $attr, wp_embed_defaults( $url ) );
|
||||
|
||||
$this->last_attr = $attr;
|
||||
|
||||
// kses converts & into & and we need to undo this
|
||||
// See https://core.trac.wordpress.org/ticket/11311
|
||||
$url = str_replace( '&', '&', $url );
|
||||
|
||||
Reference in New Issue
Block a user