Skip to:
Content

bbPress.org

Opened 13 years ago

Closed 11 years ago

#1764 closed enhancement (fixed)

Filter page title prefixes

Reported by: jaredatch's profile jaredatch Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.4 Priority: normal
Severity: normal Version: 2.0
Component: API - Actions/Filters Keywords: has-patch
Cc: wordpress@…, nashwan.doaqan@…

Description

Currently, bbPress sets the pages titles like:

Forum: The forum title here

Topic: The topic title here

with no easy way to remove the prefixes if desired. This is handled with bbp_title() in bbp-common-template.php.

Presently, it's handled by executing

$title = sprintf( __( 'Forum: %s', 'bbpress' ), bbp_get_forum_title() );

There are a few filters in place (bbp_raw_title and bbp_title) but as is would take quite a bit of elbow grease to remove prefixes that get put in place.

Ideally it would be nice if there were a few filters in place specifically for the "Singles" prefixes.

Attachments (3)

template-tags.php.patch (3.6 KB) - added by MZAWeb 12 years ago.
common-template-tags.patch (4.2 KB) - added by alex-ye 12 years ago.
common-template-tags-2.patch (5.1 KB) - added by alex-ye 11 years ago.

Download all attachments as: .zip

Change History (14)

#1 @johnjamesjacoby
12 years ago

  • Milestone changed from Future Release to 2.4

#2 @mordauk
12 years ago

  • Cc pippin@… added

#3 @MZAWeb
12 years ago

  • Cc wordpress@… added
  • Keywords has-patch added; needs-patch removed

Added patch.

Introduced a couple of filters in the form of bbp_pre_title_*

#4 @jaredatch
12 years ago

This patch looks good to me. Going to use it for a client site. Thanks MZA.

#5 @mordauk
12 years ago

  • Cc pippin@… removed

Looks good to me.

#6 @alex-ye
12 years ago

  • Cc nashwan.doaqan@… added

I think this bug is not about the prefixes only, It's about the logic of bbPress title tag, Introducing a dozen of filters is not a smart solution, The developer should have the ability to change the title 'layout' not only the prefix..

Let's imagine someone what to change this title structure

%s\'s Profile

It's hard too, right?

#7 @alex-ye
11 years ago

Changes in the second patch:

  • Change the index 'layout' to 'format'.
  • Add some missing page titles.

#8 @MZAWeb
11 years ago

@alex-ye , I _really_ like your patch.

#9 @alex-ye
11 years ago

@MZAWeb , Thanks :)

#10 @johnjamesjacoby
11 years ago

Approach is fine enough. Code needs some cleaning to be perfect, and could use bbp_parse_args() instead. Will fix up soon if no one else does.

#11 @johnjamesjacoby
11 years ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from new to closed

In 5018:

Improve the flexibility of bbp_title() by allowing all data to be filtered. Props alex-ye. Fixes #1764.

Note: See TracTickets for help on using tickets.