WordPress.org

Make WordPress Core

Changeset 33729


Ignore:
Timestamp:
08/25/2015 12:12:59 PM (5 years ago)
Author:
wonderboymusic
Message:

Media:

When inserting an image into a post, the values in wp.media.controller.Library should not default to linking the image when no user settings are present.

The default display setting value for link is now none. User settings persist and will override or confirm this value based on user actions.

Props liljimmi, janhenckens, eherman24, wonderboymusic.
Fixes #31467.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/schema.php

    r33621 r33729  
    468468    'large_size_w' => 1024,
    469469    'large_size_h' => 1024,
    470     'image_default_link_type' => 'file',
     470    'image_default_link_type' => 'none',
    471471    'image_default_size' => '',
    472472    'image_default_align' => '',
  • trunk/src/wp-includes/js/media-views.js

    r33337 r33729  
    11831183        this._displays = [];
    11841184        this._defaultDisplaySettings = {
    1185             align: defaultProps.align || getUserSetting( 'align', 'none' ),
    1186             size:  defaultProps.size  || getUserSetting( 'imgsize', 'medium' ),
    1187             link:  defaultProps.link  || getUserSetting( 'urlbutton', 'file' )
     1185            align: getUserSetting( 'align', defaultProps.align ) || 'none',
     1186            size:  getUserSetting( 'imgsize', defaultProps.size ) || 'medium',
     1187            link:  getUserSetting( 'urlbutton', defaultProps.link ) || 'none'
    11881188        };
    11891189    },
  • trunk/src/wp-includes/js/media/controllers/library.js

    r33337 r33729  
    140140        this._displays = [];
    141141        this._defaultDisplaySettings = {
    142             align: defaultProps.align || getUserSetting( 'align', 'none' ),
    143             size:  defaultProps.size  || getUserSetting( 'imgsize', 'medium' ),
    144             link:  defaultProps.link  || getUserSetting( 'urlbutton', 'file' )
     142            align: getUserSetting( 'align', defaultProps.align ) || 'none',
     143            size:  getUserSetting( 'imgsize', defaultProps.size ) || 'medium',
     144            link:  getUserSetting( 'urlbutton', defaultProps.link ) || 'none'
    145145        };
    146146    },
  • trunk/src/wp-includes/media-template.php

    r33329 r33729  
    653653                    <option value="file">
    654654                <# } else { #>
    655                     <option value="file" selected>
     655                    <option value="none" selected>
     656                        <?php esc_attr_e('None'); ?>
     657                    </option>
     658                    <option value="file">
    656659                <# } #>
    657660                    <# if ( data.model.canEmbed ) { #>
     
    671674                    <option value="custom">
    672675                        <?php esc_attr_e('Custom URL'); ?>
    673                     </option>
    674                     <option value="none">
    675                         <?php esc_attr_e('None'); ?>
    676676                    </option>
    677677                <# } #>
Note: See TracChangeset for help on using the changeset viewer.