sybrew/the-seo-framework

the_title filter hook is not working

Closed this issue · 1 comments

Describe the bug
On the latest WP and SEO Framework, "the_title" hook placed in the theme does not work.

How to reproduce the bug

  1. Add "add_filter('the_title', 'firefly_test');" and "function firefly_test($title) { return "Test"; }" to theme functions.php
  2. Title has "Test"
  3. Activate The SEO Framework
  4. Title does not have "Test"

Expected behavior
The SEO Framework should use provided content by "the_title" theme hook.

Additional context
Of course, we are not using this to add "Test", we have "%current_month%" as part of the titles and we are dynamically changing them. Also, please advise if this is not a bug and if we just using something wrong.

Hello!

the_title is for the <h1> output, not the document title.

You'd want to filter single_post_title instead. WordPress has the same behavior, so this should work with and without TSF activated.