Make WordPress Core

Ticket #23823: 23823.1.diff

File 23823.1.diff, 846 bytes (added by lancewillett, 12 years ago)
  • wp-content/themes/twentythirteen/functions.php

     
    447447function twentythirteen_featured_gallery() {
    448448        $pattern = get_shortcode_regex();
    449449
    450         if ( preg_match( "/$pattern/s", get_the_content(), $match ) ) {
    451                 if ( 'gallery' == $match[2] ) {
    452                         if ( ! strpos( $match[3], 'size' ) )
    453                                 $match[3] .= ' size="medium"';
    454 
    455                         echo do_shortcode_tag( $match );
    456                 }
     450        if ( preg_match( "/$pattern/s", get_the_content(), $match ) && 'gallery' == $match[2] ) {
     451                add_filter( 'shortcode_atts_gallery', function( $atts ) {
     452                        $atts['size'] = 'large';
     453                        return $atts;                   
     454                } );
     455                echo do_shortcode_tag( $match );
    457456        }
    458457}
    459458endif;