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.

Built from https://develop.svn.wordpress.org/branches/4.1@30915


git-svn-id: http://core.svn.wordpress.org/branches/4.1@30905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-12-16 19:21:22 +00:00
parent db3f2449d9
commit 3f71a916fa
4 changed files with 17 additions and 13 deletions

View File

@ -1049,18 +1049,17 @@
*/ */
initFrame: function() { initFrame: function() {
this.frame = wp.media({ this.frame = wp.media({
// The title of the media modal.
title: this.params.button_labels.frame_title,
// Restrict the library to specified mime type.
library: {
type: this.params.mime_type
},
button: { button: {
// Change the submit button label.
text: this.params.button_labels.frame_button text: this.params.button_labels.frame_button
}, },
multiple: false states: [
new wp.media.controller.Library({
title: this.params.button_labels.frame_title,
library: wp.media.query({ type: this.params.mime_type }),
multiple: false,
date: false
})
]
}); });
// When a file is selected, run a callback. // When a file is selected, run a callback.
@ -1264,6 +1263,7 @@
title: l10n.chooseImage, title: l10n.chooseImage,
library: wp.media.query({ type: 'image' }), library: wp.media.query({ type: 'image' }),
multiple: false, multiple: false,
date: false,
priority: 20, priority: 20,
suggestedWidth: _wpCustomizeHeader.data.width, suggestedWidth: _wpCustomizeHeader.data.width,
suggestedHeight: _wpCustomizeHeader.data.height suggestedHeight: _wpCustomizeHeader.data.height

File diff suppressed because one or more lines are too long

View File

@ -2598,6 +2598,7 @@
sortable: state.get('sortable'), sortable: state.get('sortable'),
search: state.get('searchable'), search: state.get('searchable'),
filters: state.get('filterable'), filters: state.get('filterable'),
date: state.get('date'),
display: state.has('display') ? state.get('display') : state.get('displaySettings'), display: state.has('display') ? state.get('display') : state.get('displaySettings'),
dragInfo: state.get('dragInfo'), dragInfo: state.get('dragInfo'),
@ -6227,6 +6228,8 @@
* Accepts 'uploaded' and 'all'. * Accepts 'uploaded' and 'all'.
* @param {object} [options.search=true] Whether to show the search interface in the * @param {object} [options.search=true] Whether to show the search interface in the
* browser's toolbar. * browser's toolbar.
* @param {object} [options.date=true] Whether to show the date filter in the
* browser's toolbar.
* @param {object} [options.display=false] Whether to show the attachments display settings * @param {object} [options.display=false] Whether to show the attachments display settings
* view in the sidebar. * view in the sidebar.
* @param {bool|string} [options.sidebar=true] Whether to create a sidebar for the browser. * @param {bool|string} [options.sidebar=true] Whether to create a sidebar for the browser.
@ -6240,6 +6243,7 @@
_.defaults( this.options, { _.defaults( this.options, {
filters: false, filters: false,
search: true, search: true,
date: true,
display: false, display: false,
sidebar: true, sidebar: true,
AttachmentView: media.view.Attachment.Library AttachmentView: media.view.Attachment.Library
@ -6453,7 +6457,7 @@
}).render() ); }).render() );
} }
} else { } else if ( this.options.date ) {
// DateFilter is a <select>, screen reader text needs to be rendered before // DateFilter is a <select>, screen reader text needs to be rendered before
this.toolbar.set( 'dateFilterLabel', new media.view.Label({ this.toolbar.set( 'dateFilterLabel', new media.view.Label({
value: l10n.filterByDate, value: l10n.filterByDate,

File diff suppressed because one or more lines are too long