Opened 11 years ago
Closed 10 years ago
#2561 closed enhancement (wontfix)
Filter shortcodes outputs
Reported by: | lemmonaid | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | API - Actions/Filters | Keywords: | |
Cc: |
Description
Hi guys,
I've got a little enhancement here.
Would it be possible to apply a filter on bbPress shortcodes outputs?
I suggest to change the end()
method in includes/common/shortcodes.php
file to:
private function end( $attr, $content, $shortcode ) { // Unset globals $this->unset_globals(); // Reset the query name bbp_reset_query_name(); // Return and flush the output buffer return apply_filters( ob_get_clean(), $attr, $content, $shortcode ); }
The input variables for the method would come from each shortcode function (surely, each shortcode function should have these variables as input too: $attr, $content = '', $shortcode = ''
).
Hope that makes sense ;)
Thanks,
Oliver
Change History (1)
Note: See
TracTickets for help on using
tickets.
Hi Oliver,
While it's possible to add a filter here, you'll likely want to modify template parts or filter other parameters someplace else.
Can you explain a bit more about what you're hoping to accomplish? We may be able to offer you a better solution.