[buddypress-trac] [BuddyPress Trac] #6675: WP 4.4 deprecates wp_title()

buddypress-trac noreply at wordpress.org
Thu Nov 19 10:30:26 UTC 2015


#6675: WP 4.4 deprecates  wp_title()
------------------------------------+--------------------
 Reporter:  mercime                 |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  2.4.1
Component:  Component - Core        |     Version:
 Severity:  major                   |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+--------------------
Changes (by imath):

 * keywords:  has-patch => has-patch dev-feedback


Comment:

 First, thanks a lot @r-a-y for your patch, i've tested it and i confirm
 it's working fine. But i had another idea after a very good night of sleep
 :)

 Actually thinking about the reply i have to give to @DJPaul about why
 using 2 filters in 02.patch made me change my mind. If i was using 2
 different filters that was because :
 when we filter `document_title_parts` we are returning an '''array''' and
 when we are filtering `wp_title` we are returning a '''string''' so this:
 > The other arguments look the same

 is not exactly true :)

 About this particulare issue, I finally strongly believe we shouldn't
 think '''OR''' but '''AND'''. All the patches we've built so far was
 thinking OR : filter `wp_title` if WP < 4.4 or `document_title_parts` if
 WP >= 4.4.

 But what if we filter both no matter what WP version is in use ? Some
 contextual infos :
 - Themes using `wp_title` are not supporting the `wp-title` feature ->
 meaning the `document_title_parts` filter won't be fired
 - Configs using WP < 4.4 won't fire the `document_title_parts` filter
 - Themes supporting the `wp-title` feature are not using the `wp_title`
 function anymore -> meaning the `wp_title` filter won't be fired
 - There's a good chance BreadCrumbs plugins are still using `wp_title`
 although the theme is supporting `wp-title`

 If we include both filters at the same time: we are making sure all these
 points will be taken care of. And when `wp_title` will finally be
 deprecated, we will be able to also deprecate `bp_modify_page_title` (oops
 spoken too quick... only once our required version is 4.4 :) ).

 In this spirit, 04.patch is :
 - moving the part of `bp_modify_page_title` that was building the
 BuddyPress title parts in its own function : `bp_get_title_parts()`
 - keeping the wp_title filter the way it was
 - adding a new function `bp_modify_document_title_parts` to filter
 `document_title_parts`
 - removing `_bp_strip_spans_from_title()` because what we need to do is to
 remove the span count class for title parts and BuddyPress dynamic nav
 menus, which is now achieved with `bp_remove_span_count()`

 What is the extra benefit, other than it works: plugins will be able to
 use `bp_get_title_parts()` directly to get BuddyPress title parts if
 needed.

 What do you think ?

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


More information about the buddypress-trac mailing list