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,21 +577,27 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wp.media.galleryDefaults = {
|
||||||
|
itemtag: 'dl',
|
||||||
|
icontag: 'dt',
|
||||||
|
captiontag: 'dd',
|
||||||
|
columns: '3',
|
||||||
|
link: 'post',
|
||||||
|
size: 'thumbnail',
|
||||||
|
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({
|
wp.media.gallery = new wp.media.collection({
|
||||||
tag: 'gallery',
|
tag: 'gallery',
|
||||||
type : 'image',
|
type : 'image',
|
||||||
editTitle : wp.media.view.l10n.editGalleryTitle,
|
editTitle : wp.media.view.l10n.editGalleryTitle,
|
||||||
defaults : {
|
defaults : wp.media.galleryDefaults
|
||||||
itemtag: 'dl',
|
|
||||||
icontag: 'dt',
|
|
||||||
captiontag: 'dd',
|
|
||||||
columns: '3',
|
|
||||||
link: 'post',
|
|
||||||
size: 'thumbnail',
|
|
||||||
order: 'ASC',
|
|
||||||
id: wp.media.view.settings.post && wp.media.view.settings.post.id,
|
|
||||||
orderby : 'menu_order ID'
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue