[wp-trac] [WordPress Trac] #28693: Make gallery defaults configurable
WordPress Trac
noreply at wordpress.org
Fri Jul 18 17:01:39 UTC 2014
#28693: Make gallery defaults configurable
-------------------------------------+-----------------------------
Reporter: michal429 | Owner: wonderboymusic
Type: enhancement | Status: reopened
Priority: normal | Milestone: 4.0
Component: Gallery | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses: javascript
-------------------------------------+-----------------------------
Changes (by GregLone):
* status: closed => reopened
* resolution: worksforme =>
Comment:
Replying to [comment:10 adamsilverstein]:
> I don't think my proposed filter is needed and it will not be included
in core, sorry for any confusion this created. The resolution took a
different approach:
>
> You can override the settings in JavaScript by setting
wp.media.view.settings.galleryDefaults with what you want (in trunk after
wonderboymusic's patch above)
Indeed, and that's what I'm doing with the filter:
`$settings['galleryDefaults']` will populate the JS variable
`_wpMediaViewsL10n`, and then will set
`wp.media.view.settings.galleryDefaults`. So, my custom values are in
`wp.media.view.settings.galleryDefaults`. The problem is that values alone
do (almost) nothing.
> You can change the defaults from PHP by filtering shortcode_atts_gallery
- this code sample shows how -
https://gist.github.com/adamsilverstein/cd2675feb7233e4849b7
Yep, I know.
> Hope that makes sense and works to resolve your issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28693#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list