Support » Fixing WordPress » add_filter being ignored

  • I’m trying to create my own custom gallery by attaching to the post_gallery filter. I found info on how to do this

    I can’t seem to get my function called and I’m pulling out my hair trying to figure out why. I’m using Vantage (site origin) theme and Orbisius Child Theme Creator to create a child theme. My child theme’s other code in it’s functions.php is being called just fine, but even with things as simple as this:

    add_filter( 'post_gallery', 'my_post_gallery', 10, 2 );
    function my_post_gallery( $output, $attr) {
         return "HelloWorld";

    … there is no effect at all on any galleries (it ought to break them all and just put the text in their place). Can anyone shed any light on why this might be happening?

    Edit: Within it’s own code, in inc/gallery.php Vantage uses this same add_filter hook itself (to define it’s own custom type of gallery) and that definitely does get called because adding the “helloworld” there breaks all the galleries… It makes me wonder if Vantage is somehow removing my add_filter call…?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘add_filter being ignored’ is closed to new replies.