Last active
August 29, 2015 13:58
-
-
Save 2ndkauboy/9934495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Gallery Shortcode Change Default Images Size | |
Description: Plugin to change the default image size of the gallery shortcode | |
Version: 0.1 | |
Author: Bernhard Kau | |
Author URI: http://kau-boys.de | |
*/ | |
function gallery_shortcode_change_default_size( $out, $pairs, $atts ) { | |
if ( '1' == $atts[ 'columns' ] ) { | |
$out[ 'size' ] = 'large'; | |
} elseif ( '2' == $atts[ 'columns' ] ) { | |
$out[ 'size' ] = 'medium'; | |
} | |
return $out; | |
} | |
add_filter( 'shortcode_atts_gallery', 'gallery_shortcode_change_default_size', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment