Last active
September 15, 2020 19:46
-
-
Save NickGreen/8639c44add0df6638edf95bcaef40612 to your computer and use it in GitHub Desktop.
Filter classic editor gallery shortcodes
This file contains hidden or 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 | |
/* filter gallery output*/ | |
add_filter( 'shortcode_atts_gallery', 'my_shortcode_atts_gallery', 10, 4 ); | |
function my_shortcode_atts_gallery( $out, $pairs, $atts, $shortcode ) { | |
if ( ! isset( $atts['columns'] ) ) { | |
$out['columns'] = 1; | |
} | |
if ( ! isset( $atts['size'] ) ) { | |
$out['size'] = 'full'; | |
} | |
if ( ! isset( $atts['link'] ) ) { | |
$out['link'] = 'none'; | |
} | |
return $out; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment