Skip to:
Content

bbPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1983 closed enhancement (fixed)

Pass more parameters into bbp_get_forum_freshness_link filter.

Reported by: jbobich Owned by:
Milestone: 2.3 Priority: normal
Severity: trivial Version: 2.1
Component: Front-end Keywords: has-patch
Cc: jbobich, stephen@…

Description

In the bbp_get_forum_freshness_link function, the filtered markup you're returning seems to have three key items:

  1. URL of the link.
  2. Title for the link.
  3. Time since the last thing happened.

It'd make sense if I were going to add a filter and create my own markup for the freshness link, I'd want those three elements available to me, opposed to having to do the work in my function to figure them out again with the $forum_id passed in or picking out the pieces of the original $anchor string somehow.

Maybe I'm off-base; you could probably say "Why stop there? Just pass it ALL in." -- who knows, just a suggestion.

Attachments (3)

1983.patch (503 bytes) - added by jbobich 8 years ago.
1983-2.patch (820 bytes) - added by jbobich 8 years ago.
In the first patch, I forgot to take into account the fact that it's possible $title and $link_url variables may not exist. This would solve that.
1983-3.patch (1.3 KB) - added by jbobich 8 years ago.
Added same parameters to bbp_get_topic_freshness_link in the same order. Also added $active_id to bbp_get_forum_freshness_link, but note it has been added as the last parameter. This is necessary so someone could theoretically use the same function to filter both of these if they were to disregard $active_id.

Download all attachments as: .zip

Change History (8)

@jbobich
8 years ago

@jbobich
8 years ago

In the first patch, I forgot to take into account the fact that it's possible $title and $link_url variables may not exist. This would solve that.

#1 follow-up: @johnjamesjacoby
8 years ago

  • Milestone changed from Awaiting Review to 2.2

Could include $active_id here.

There are a few other _freshness_ links that could have things passed into them also.

#2 in reply to: ↑ 1 ; follow-up: @jbobich
8 years ago

Replying to johnjamesjacoby:

Could include $active_id here.

Yeah, definitely. I'm just not sure where the line should be drawn on these kinds of things going through many of the filters, or if it matters.

@jbobich
8 years ago

Added same parameters to bbp_get_topic_freshness_link in the same order. Also added $active_id to bbp_get_forum_freshness_link, but note it has been added as the last parameter. This is necessary so someone could theoretically use the same function to filter both of these if they were to disregard $active_id.

#3 @netweb
8 years ago

  • Cc stephen@… added

#4 @johnjamesjacoby
8 years ago

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

(In [4515]) Pass more variables into freshness link filters. Props jbobich. Fixes #1983.

#5 in reply to: ↑ 2 @johnjamesjacoby
8 years ago

Replying to jbobich:

Yeah, definitely. I'm just not sure where the line should be drawn on these kinds of things going through many of the filters, or if it matters.

It matters very little. Parameters are broken down into an arrays and passed around, so it's already happening anyways.

Feel free to patch anything else similar to this if you find it. They're easy wins.

Note: See TracTickets for help on using tickets.