Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: current bbpress support forum template – time for update?

The difference between actions and filters is unclear. In principle, filters are supposed to let you modify data and actions give you a chance to respond to events. This is reflected most in the fact that with a filter, you have to return some data which will be used instead of the data given to you in the first place. For actions, you don’t.

The syntax is this:

do_action('action_name', [$argument1, [$argument 2 [...]]]);
apply_filters('filter_name', [$argument1, [$argument 2 [...]]]);

I don’t recommend making changes to the core, of course. But if you have to, you would change the last line of topic_time() from this:

echo _bb_time_function_return( $time, $args );

to this:

echo apply_filters('template_time', _bb_time_function_return( $time, $args ));

and then change the line in the plugin further up to this:

add_filter('template_time', 'freshness_latestlink', 101);

taking out the // that comment it out. Also, I’m not sure what topic_class*() is?

But yeah, don’t modify the core. Much better to stick to the template change from above. :)

Skip to toolbar