WordPress.org

Make WordPress Core

Changeset 28689


Ignore:
Timestamp:
06/06/2014 02:21:12 PM (7 years ago)
Author:
wonderboymusic
Message:

As per @gcorne's suggestion, when calling wp.mce.views.register(), automatically set shortcode equal to the passed type in the set of default args instead of introducing a type property. It is still overrideable by the args that are passed.

See #28458.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/mce-view.js

    r28680 r28689  
    7777        register: function( type, constructor ) {
    7878            var defaultConstructor = {
    79                     type: type,
     79                    shortcode: type,
    8080                    View: {},
    8181                    toView: function( content ) {
    82                         var match = wp.shortcode.next( this.type, content );
     82                        var match = wp.shortcode.next( this.shortcode, content );
    8383
    8484                        if ( ! match ) {
     
    482482     */
    483483    wp.mce.views.register( 'video', _.extend( {}, wp.mce.av, {
    484         shortcode: 'video',
    485484        state: 'video-details',
    486485        View: _.extend( {}, wp.mce.av.View, {
     
    495494     */
    496495    wp.mce.views.register( 'audio', _.extend( {}, wp.mce.av, {
    497         shortcode: 'audio',
    498496        state: 'audio-details',
    499497        View: _.extend( {}, wp.mce.av.View, {
     
    508506     */
    509507    wp.mce.views.register( 'playlist', _.extend( {}, wp.mce.av, {
    510         shortcode: 'playlist',
    511508        state: ['playlist-edit', 'video-playlist-edit'],
    512509        View: _.extend( {}, wp.media.mixin, {
     
    639636     */
    640637    wp.mce.views.register( 'embed', {
    641         shortcode: 'embed',
    642638        View: _.extend( {}, wp.media.mixin, {
    643639            template: media.template( 'editor-embed' ),
Note: See TracChangeset for help on using the changeset viewer.