[Resolved] Show title filter is not applied

Home Forums Support [Resolved] Show title filter is not applied

Home Forums Support Show title filter is not applied

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #259696
    Martin

    Hi,

    I have a strange effect with this filter, if I activate it in snippets all page titles are still shown:

    add_filter( 'generate_show_title', '__return_false' );

    But if I change the code directly in functions.php and force a return value of false it works.

    Other filters in the same snippet are applied correctly (e.g. generate_get_blog_page_header).

    Any ideay why this could fail?

    Regards
    Martin

    #259752
    Tom
    Lead Developer
    Lead Developer

    It may need to be placed in the after_setup_theme hook: https://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme

    add_action( 'after_setup_theme','tu_after_setup_theme' );
    function tu_after_setup_theme() {
        add_filter( 'generate_show_title', '__return_false' );
    }
    #259848
    Martin

    That is correct, with this snippet it works as intended.
    Thank you.

    Martin

    #259953
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.