Make WordPress Core

Changeset 30872


Ignore:
Timestamp:
12/15/2014 08:26:54 PM (12 years ago)
Author:
ocean90
Message:

Customizer: Remove date filter from the Header/Background Image upload frames.

Adds an option to wp.media.view.AttachmentsBrowser to hide the date filter added in [29813].

see #30689.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r30871 r30872  
    10611061                initFrame: function() {
    10621062                        this.frame = wp.media({
    1063                                 // The title of the media modal.
    1064                                 title: this.params.button_labels.frame_title,
    1065 
    1066                                 // Restrict the library to specified mime type.
    1067                                 library: {
    1068                                         type: this.params.mime_type
    1069                                 },
    10701063                                button: {
    1071                                         // Change the submit button label.
    10721064                                        text: this.params.button_labels.frame_button
    10731065                                },
    1074                                 multiple: false
     1066                                states: [
     1067                                        new wp.media.controller.Library({
     1068                                                title:     this.params.button_labels.frame_title,
     1069                                                library:   wp.media.query({ type: this.params.mime_type }),
     1070                                                multiple:  false,
     1071                                                date:      false
     1072                                        })
     1073                                ]
    10751074                        });
    10761075
     
    12761275                                                library:   wp.media.query({ type: 'image' }),
    12771276                                                multiple:  false,
     1277                                                date:      false,
    12781278                                                priority:  20,
    12791279                                                suggestedWidth: _wpCustomizeHeader.data.width,
  • trunk/src/wp-includes/js/media-views.js

    r30792 r30872  
    25992599                                search:     state.get('searchable'),
    26002600                                filters:    state.get('filterable'),
     2601                                date:       state.get('date'),
    26012602                                display:    state.has('display') ? state.get('display') : state.get('displaySettings'),
    26022603                                dragInfo:   state.get('dragInfo'),
     
    62286229         * @param {object}      [options.search=true]   Whether to show the search interface in the
    62296230         *                                              browser's toolbar.
     6231         * @param {object}      [options.date=true]     Whether to show the date filter in the
     6232         *                                              browser's toolbar.
    62306233         * @param {object}      [options.display=false] Whether to show the attachments display settings
    62316234         *                                              view in the sidebar.
     
    62416244                                filters: false,
    62426245                                search:  true,
     6246                                date:    true,
    62436247                                display: false,
    62446248                                sidebar: true,
     
    64546458                                }
    64556459
    6456                         } else {
     6460                        } else if ( this.options.date ) {
    64576461                                // DateFilter is a <select>, screen reader text needs to be rendered before
    64586462                                this.toolbar.set( 'dateFilterLabel', new media.view.Label({
Note: See TracChangeset for help on using the changeset viewer.