[wp-trac] [WordPress Trac] #28693: Make gallery defaults configurable

WordPress Trac noreply at wordpress.org
Mon Jul 21 02:16:11 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
-------------------------------------+-----------------------------

Comment (by adamsilverstein):

 Why are you re-opening the ticket, do you still have an issue?

 Replying to [comment:11 GregLone]:
 > 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:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list