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:
parent
0510e0e589
commit
1571d3c47c
|
@ -577,11 +577,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
wp.media.gallery = new wp.media.collection({
|
||||
tag: 'gallery',
|
||||
type : 'image',
|
||||
editTitle : wp.media.view.l10n.editGalleryTitle,
|
||||
defaults : {
|
||||
wp.media.galleryDefaults = {
|
||||
itemtag: 'dl',
|
||||
icontag: 'dt',
|
||||
captiontag: 'dd',
|
||||
|
@ -591,7 +587,17 @@
|
|||
order: 'ASC',
|
||||
id: wp.media.view.settings.post && wp.media.view.settings.post.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
Loading…
Reference in New Issue