Make WordPress Core

Changeset 30915


Ignore:
Timestamp:
12/16/2014 07:20:31 PM (12 years ago)
Author:
johnbillion
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].

Merges [30872] to the 4.1 branch.

See #30689.

Location:
branches/4.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1

  • branches/4.1/src/wp-admin/js/customize-controls.js

    r30738 r30915  
    10501050                initFrame: function() {
    10511051                        this.frame = wp.media({
    1052                                 // The title of the media modal.
    1053                                 title: this.params.button_labels.frame_title,
    1054 
    1055                                 // Restrict the library to specified mime type.
    1056                                 library: {
    1057                                         type: this.params.mime_type
    1058                                 },
    10591052                                button: {
    1060                                         // Change the submit button label.
    10611053                                        text: this.params.button_labels.frame_button
    10621054                                },
    1063                                 multiple: false
     1055                                states: [
     1056                                        new wp.media.controller.Library({
     1057                                                title:     this.params.button_labels.frame_title,
     1058                                                library:   wp.media.query({ type: this.params.mime_type }),
     1059                                                multiple:  false,
     1060                                                date:      false
     1061                                        })
     1062                                ]
    10641063                        });
    10651064
     
    12651264                                                library:   wp.media.query({ type: 'image' }),
    12661265                                                multiple:  false,
     1266                                                date:      false,
    12671267                                                priority:  20,
    12681268                                                suggestedWidth: _wpCustomizeHeader.data.width,
  • branches/4.1/src/wp-includes/js/media-views.js

    r30792 r30915  
    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.