Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 6 years ago

#4240 closed enhancement (maybelater)

Make "get pagination" filters more conventionalized

Reported by: cklosows's profile cklosows Owned by:
Milestone: Priority: normal
Severity: minor Version: 1.5.5
Component: Core Keywords: needs-patch, trac-tidy-2018
Cc: cklosowski@…

Description

The filters for getting pagination for groups, forums, and topics are all named slightly differently, making adding filters more difficult to do without looking up the code in the core file:

bp_get_the_topic_pagination
bp_get_groups_pagination_links
bp_get_forum_pagination

I propose creating a naming convention for these since they all return the same type of data, full html of the pagination.

bp_get_[type]_pagination

Change History (8)

#1 @cklosows
12 years ago

I will get a patch together for this in the next day or so.

#2 follow-up: @boonebgorges
12 years ago

Cool. A tip: We can't just rename filters for backward compatibility reasons, so the best practice is to add a new filter, and leave an inline comment to the effect of "use this one, not that one".

#3 in reply to: ↑ 2 @cklosows
12 years ago

Replying to boonebgorges:

Cool. A tip: We can't just rename filters for backward compatibility reasons, so the best practice is to add a new filter, and leave an inline comment to the effect of "use this one, not that one".

Noted. I'll remember that as I'm writing the patch. I had planned on doing something like that but thanks for the official stance. :)

#4 @DJPaul
12 years ago

  • Component changed from Core to All Components
  • Milestone changed from Awaiting Review to Future Release

#5 @DJPaul
8 years ago

  • Component changed from Component - Any/All to Core

#6 @tw2113
8 years ago

While we definitely can't remove the old ones, we can soft deprecate them and put the newly consistent ones immediately after.

$foo = apply_filters( 'old_filter', $thing, $thing );
$foo = apply_filters( 'new_filter', $thing, $thing );

We can also move to conditionally assign the values from the old filters only if has_action/has_filter returns true. This would instead have us using the new hooks first, followed by the old ones.

$foo = apply_filters( 'new_filter', $thing, $thing );
if ( has_filter( 'old_filter' ) ) {
    $foo = apply_filters( 'old_filter', $thing, $thing );
}

#7 @DJPaul
6 years ago

  • Keywords trac-tidy-2018 added

We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.

Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.

If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.

For more information, see https://bpdevel.wordpress.com/2018/01/21/our-awaiting-contributions-milestone-contains/
or find us on Slack, in the #buddypress channel: https://make.wordpress.org/chat/

#8 @DJPaul
6 years ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.