[wp-trac] [WordPress Trac] #28693: Make gallery defaults configurable
WordPress Trac
noreply at wordpress.org
Wed Jul 2 17:38:54 UTC 2014
#28693: Make gallery defaults configurable
------------------------------------+------------------------
Reporter: michal429 | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Gallery | Version: trunk
Severity: normal | Resolution: duplicate
Keywords: has-patch dev-feedback | Focuses:
------------------------------------+------------------------
Changes (by adamsilverstein):
* keywords: => has-patch dev-feedback
Comment:
michal429 -
Seems like what you need here is a way to filter the default values -
which are currently hard-coded into the media-editor.js JavaScript. I can
certainly see the use case for this!
I am attempting this in [attachment:28693.diff], moved default values over
to wp.media.view.settings.galleryDefaults which you can adjust using the
existing media_view_settings filter. For example, to set the default value
gallery columns you would do something like this:
{{{
function my_set_gallery_default_five_columns( $settings ) {
$settings['galleryDefaults']['columns'] = '5';
return $settings;
}
add_filter( 'media_view_settings', 'my_set_gallery_default_five_columns',
10 );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28693#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list