WordPress.org

Ready to get started?Download WordPress

Forums

add_filter being ignored (2 posts)

  1. dwaharvey
    Member
    Posted 6 months ago #

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

    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...?

  2. orbisius
    Member
    Posted 6 months ago #

    Hi,

    Please post the question in the support forums of the theme you picked.

Reply

You must log in to post.

About this Topic