# WP Discourse: custom filters for discourse\_replies\_html and discourse\_no\_replies\_html

**URL:** <https://meta.discourse.org/t/wp-discourse-custom-filters-for-discourse-replies-html-and-discourse-no-replies-html/106306>\
**Category:** WordPress\
**Created:** [11.Январь.2019 18:42:53 UTC](https://meta.discourse.org/t/wp-discourse-custom-filters-for-discourse-replies-html-and-discourse-no-replies-html/106306 "2019-01-11T18:42:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [11.Январь.2019 18:54:33 UTC](https://meta.discourse.org/t/wp-discourse-custom-filters-for-discourse-replies-html-and-discourse-no-replies-html/106306/2 "2019-01-11T18:54:33Z")

</div>

> [@Kayla](#):
>
> Thinking with the changes needed to be made to the discourse\_publish\_format\_html filter ([WP Discourse: advanced custom filter for discourse\_publish\_format\_html](https://meta.discourse.org/t/wp-discourse-advanced-custom-filter-for-discourse-publish-format-html/106059/9)), I changed both my replies functions/filters like so:

I think that’s the problem. The `discourse_replies_html` filter only accepts one argument. Something like this should work:

```plaintext
function cosmos_custom_discourse_replies( $input ) {
    ob_start();
    ?>
    custom output here
    <?php
    $output = ob_get_clean();
    return $output;
}
add_filter( 'discourse_replies_html', 'cosmos_custom_discourse_replies' );

```

You can see all the templates here: [wp-discourse/templates/html-templates.php at main · discourse/wp-discourse · GitHub](https://github.com/discourse/wp-discourse/blob/master/templates/html-templates.php). Look at the call to `apply_filters` at the bottom of each template to see the parameters that are passed to the filter.

---

_[View the full topic](https://meta.discourse.org/t/wp-discourse-custom-filters-for-discourse-replies-html-and-discourse-no-replies-html/106306)._
