WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#36810 closed defect (bug) (duplicate)

Make gallery defaults configurable

Reported by: frymi Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.2
Component: Gallery Keywords:
Focuses: Cc:
PR Number:

Description

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' );

Change History (1)

#1 @SergeyBiryukov
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #35654.

Note: See TracTickets for help on using tickets.