[buddypress-trac] [BuddyPress Trac] #6107: Missing site titles for BP pages in Twenty Fifteen and new themes which add support to the new title-tag feature

buddypress-trac noreply at wordpress.org
Tue Jan 20 02:30:24 UTC 2015


#6107: Missing site titles for BP pages in Twenty Fifteen and new themes which add
support to the new title-tag feature
--------------------------+------------------
 Reporter:  mercime       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.2
Component:  Core          |     Version:
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------
Changes (by imath):

 * keywords:   => has-patch


Comment:

 Checking `current_theme_supports( 'title-tag' )` seems impossible! it
 looks like it's only defined at wp_head with a priority of 1, very
 strange. So i gave up and choose another way as this support is really new
 in WordPress and might evolved.

 Since WordPress 4.0, there's an interesting new filter that can save us :)
 `'wp_title_parts'`. So as we support WordPress down to 3.6, here's the
 plan i suggest :

 filter `'wp_title_parts'` and `'wp_title'`, most of the time (i hope so)
 we'll get `'wp_title_parts'`, in this case we simply have to
 `remove_filter( 'wp_title' )`. In the first case, we need to return an
 array, if we are in the second case, we just need to `join()` this array
 with the `$sep`.

 This is what i have done in 6107.patch. I've tested it in TwentyFifteen
 and Twentytwelve and it works fine. In twentytwelve, i've removed the
 filter to `'wp_title_parts'` in order to check it was still working, and
 it's the case :)

 What do you think of this plan ?

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6107#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list