[buddypress-trac] [BuddyPress Trac] #6765: Use WP page names for BP directory pages headings

buddypress-trac noreply at wordpress.org
Tue Dec 8 21:10:11 UTC 2015


#6765: Use WP page names for BP directory pages headings
---------------------------------+-------------------------
 Reporter:  hnla                 |      Owner:
     Type:  enhancement          |     Status:  new
 Priority:  normal               |  Milestone:  2.5
Component:  Component - Any/All  |    Version:
 Severity:  normal               |   Keywords:  needs-patch
---------------------------------+-------------------------
 Currently we set a hardcoded heading string for our main directory pages
 e.g Activity stream directory receives the title heading 'Site-Wide
 Activity'

 Regardless of what we may set as the page name if we edit or create our
 own WP pages and assign in BP settings as pages to use BP will ignore the
 WP name re-setting the 'post_title' (bp-*-screens.php >
 `directory_dummy_post()` ) to the hardcoded string in
 `buddypress()->{$component}->directory_title`.

 For users, and some developers this may be less than intuitive if they are
 used to WP pages name and slug being the strings used normally, and if
 wanting to change the BP strings they are left having to either filter (
 admittedly easy enough to achieve for devs ) or having to do a text string
 translation, hard for many to grapple with.

 Ticket proposes that we change this behaviour by addressing how we build
 {{{bp_core_get_directory_title()}}}

 This function returns $title as set to
 `buddypress()->{$component}->directory_title` our dummy_post function then
 sets `'post_title' => bp_get_directory_title( 'activity' ),`

 Changing $title to `bp_core_get_directory_pages()->{$component}->title`
 will build the title string from the array BP builds of assigned or
 created pages.

 In the simplest sense this change works as expected to change the title
 printed and the doc title element without apparent issues.

 Issues and testing:

 Need to establish when `bp_core_get_directory_page_ids()` is built as this
 array is required before we build out $pages if $pages isn't in the
 wp_cache.

 If we have $pages populated at point where BP initially creates pages then
 it should be safe.

 Need to test what happens on initialising BP on a new site.

 Simply making this change may not be advised as we could change the
 headings on established sites unexpectedly and cause consternation with
 users, this is the usual problem with this sort of change, if we did this
 we may need something implemented such as a checkbox on the page settings
 in BP which if checked i.e 'true' would effect this change to using the
 page heading as set in the actual WP page else if false the established
 strings would continue to be used.

 I'll push a patch up when I've done a little more testing.

 I had thought there was a ticket already on this subject but couldn't
 locate one.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6765>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list