WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/05/2015 05:59:10 AM (6 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-embed.php

    r31066 r31620  
    1212    public $usecache = true;
    1313    public $linkifunknown = true;
     14    public $last_attr = array();
     15    public $last_url = '';
    1416
    1517    /**
     
    135137        }
    136138
    137         if ( empty( $url ) )
     139        $this->last_url = $url;
     140
     141        if ( empty( $url ) ) {
     142            $this->last_attr = $attr;
    138143            return '';
     144        }
    139145
    140146        $rawattr = $attr;
    141147        $attr = wp_parse_args( $attr, wp_embed_defaults( $url ) );
     148
     149        $this->last_attr = $attr;
    142150
    143151        // kses converts & into & and we need to undo this
Note: See TracChangeset for help on using the changeset viewer.