• I have a plugin like so:

    <?php
    /* Author info */
    
    add_filter('post_gallery', 'kg_gallery_shortcode');
    
    function kg_gallery_shortcode($attr) {
    	global $post;
    
    	extract(shortcode_atts(array(
    		'id' => $post->ID,
    		'ex' => ''
    	), $attr));
    
    /* ... */
    }
    ?>

    Well the plugin works fine doing everything I need to do with the default [gallery] tag, but it seems like it completely ignores any attributes, e.g. [gallery ex="2"] or even [gallery id="1"].

    I tried changing the filter addition to

    add_filter('post_gallery', 'kg_gallery_shortcode', 1, 1);

    But that changed nothing. Why isn’t anything coming through on the argument array?

    Thanks.

  • The topic ‘post_gallery filter not passing arguments of gallery shortcode’ is closed to new replies.