Opened 5 years ago
Closed 5 years ago
#34930 closed defect (bug) (invalid)
Wordpress 4.4 - wp_title filter no longer being called
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
I was using 4.3.1 and using apply_filter('wp_title',...) to alter my page title. I notice that the filter never gets called after upgrading to 4.4 (on Dec 8th 2015). I decided to go into wp-includes/general-template.php and place an error_log("Hello") inside the function wp_title() at the top to see if it was ever called. No it wasn't. Huh? Some times i do see it called but it isnt consistent anymore.
Any ideas?
Change History (3)
#2
in reply to:
↑ 1
@
5 years ago
Thanks for the info..was just looking and the problem seems to be _wp_render_title_tag(..)....it seems to have changed from 4.3 which used wp_title in the function but now uses wp_get_document_title().
I am in the process to see if there is a filter for that and then can rewrite some code to work through that instead of wp_title().
You mentioned new realted filters for my case. What are they by chance?
UPDATE:
Found the filters at the link you provided. I will begin the conversion process.
thanks
Hi there
Which theme are you using? Did you perhaps update your theme too?
Themes are encouraged to not use
wp_title()
anymore but instead useadd_theme_support( 'title-tag' );
(available since 4.1). See https://make.wordpress.org/core/2015/10/20/document-title-in-4-4/ for more information.If your theme already implements the new method, you need to use one of the new filters.
That doesn't really make sense to me. Are you sure this is the case?