overriding bbpress template-tag function
-
I hope this has a very simple solution.
I need to either stop a BBpress template-tags function from happening, or over-ride it with a new one, but want to do this from a plugin, rather than amending BBpress code.
Is there a line of code that simply stops a function within BBpress, or a quick way to overwrite one using a plugin.
More detail below
I want to revise the
bbp_single_topic_description
which is currently used incontent-single-topic.php
to show the phrase “This topic contains 2 replies, has 2 voices etc.” below a postThe
bbp_single_topic_description
is defined in/includes/topics/template-tags.php
I have written a pluggin that creates a new function, and uses the
bbp_template_before_single_topic
action hook incontent-single-topic.php
to display the new wording .ie
add_action( 'bbp_template_before_single_topic', 'btv_single_topic_description'); function btv_single_topic_description( $args = '' ) { CODING STUFF; }
But I need to stop the old wording displaying as well as this.
I have three approaches
1. Just comment out the appropriate line in
content-single-topic.php
– simple to do, but of course gets overwritten by new releases
2. Do something in the plugin that stopsbbp_single_topic_description
from working using code within my plugin – if this is easy, that is what I’d like to do, but as the function doesn’t have an action hook as far as I know, I don’t know how to remove it.
3. Do something to make my function replace/overwrite the bbpress function, so that I don’t have to hook it anywhere?Can anyone help me with either 2 or 3 – I hope it’s an easy answer, but am stumped !
- You must be logged in to reply to this topic.