Allow users to override default gallery settings in JS via `wp_localize_script()`. This is already possible in PHP by filtering `shortcode_atts_gallery`.

Fixes #28693.

Built from https://develop.svn.wordpress.org/trunk@28990


git-svn-id: http://core.svn.wordpress.org/trunk@28778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-07-04 02:03:14 +00:00
parent 0510e0e589
commit 1571d3c47c
2 changed files with 18 additions and 12 deletions

View File

@ -577,11 +577,7 @@
}); });
}; };
wp.media.gallery = new wp.media.collection({ wp.media.galleryDefaults = {
tag: 'gallery',
type : 'image',
editTitle : wp.media.view.l10n.editGalleryTitle,
defaults : {
itemtag: 'dl', itemtag: 'dl',
icontag: 'dt', icontag: 'dt',
captiontag: 'dd', captiontag: 'dd',
@ -591,7 +587,17 @@
order: 'ASC', order: 'ASC',
id: wp.media.view.settings.post && wp.media.view.settings.post.id, id: wp.media.view.settings.post && wp.media.view.settings.post.id,
orderby : 'menu_order ID' orderby : 'menu_order ID'
};
if ( wp.media.view.settings.galleryDefaults ) {
_.extend( wp.media.galleryDefaults, wp.media.view.settings.galleryDefaults );
} }
wp.media.gallery = new wp.media.collection({
tag: 'gallery',
type : 'image',
editTitle : wp.media.view.l10n.editGalleryTitle,
defaults : wp.media.galleryDefaults
}); });
/** /**

File diff suppressed because one or more lines are too long