Using shortcode_atts_gallery filter
-
Is it possible to use the shortcode_atts_gallery filter to change the standard gallery image size?
Like this:
/* Register shortcode_atts_gallery filter callback */
add_filter( ‘shortcode_atts_gallery’, ‘xy_gallery_atts’, 10, 3 );/* Change attributes of wp gallery to modify image sizes for your needs */
function xy_gallery_atts( $output, $pairs, $atts ) {/* You can use these sizes:
– thumbnail
– medium
– large
– full
or, if your theme/plugin generate additional custom sizes you can use them as well
*/$output[‘size’] = ‘medium’; //i.e. This will change all your gallery images to “medium” size
return $output;
}Because I define a custom image size for Gallery-Thumbnails in the functions.php.
Thank’s
- The topic ‘Using shortcode_atts_gallery filter’ is closed to new replies.