[wp-trac] [WordPress Trac] #36810: Make gallery defaults configurable
WordPress Trac
noreply at wordpress.org
Tue May 10 20:54:50 UTC 2016
#36810: Make gallery defaults configurable
--------------------------+-----------------------------
Reporter: frymi | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Gallery | Version: 4.5.2
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
in file:
./wp-includes/media-template.php
wrong code:
{{{
<option value="<?php echo esc_attr( $size ); ?>">
}}}
change to:
{{{
<option value="<?php echo esc_attr( $size ); ?>" <# if ( "<?php echo
esc_attr( $size ); ?>" == wp.media.galleryDefaults.size ) {
#>selected="selected"<# } #> >
}}}
for use:
{{{
function theme_gallery_defaults( $settings ) {
$settings['galleryDefaults']['size'] = 'medium';
return $settings;
}
add_filter( 'media_view_settings', 'theme_gallery_defaults' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36810>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list