# Template hook for Discourse Plugin "Join Discussion Link" section?

**URL:** <https://meta.discourse.org/t/template-hook-for-discourse-plugin-join-discussion-link-section/323878>\
**Category:** WordPress\
**Created:** [August 28, 2024, 9:52pm UTC](https://meta.discourse.org/t/template-hook-for-discourse-plugin-join-discussion-link-section/323878 "2024-08-28T21:52:23Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)\
**Post date:** [September 19, 2024, 6:32am UTC](https://meta.discourse.org/t/template-hook-for-discourse-plugin-join-discussion-link-section/323878/8 "2024-09-19T06:32:16Z")

</div>

Ok, so I think I’ll need to make sure you’ve got the variables you’re interpolating there, which does make sense for this filter, i.e.

```php
apply_filters( 'wpdc_join_discussion_link_html', $link_html, $discourse_permalink, $new_tab, $link_text )

```

Which you’d then use like so (note the number of arguments)

```php
function custom_discussion_link( $link_html, $discourse_permalink, $new_tab, $link_text) {  
  ob_start();
  ?>
  <div class="wpdc-join-discussion">
    <div class="custom-wrapper-div">
      <h3>Heading</h3>
      <p>Explanation/context yada yada.</p>
      <?php echo '<a class="wpdc-join-discussion-link" href="' . esc_url_raw( $discourse_permalink ) . '"' . $new_tab . '>' . esc_html( $link_text ) . '</a>'; ?>
    </div>
  </div>
  <?php
  $link_html = ob_get_clean();
  return $link_html;
}
add_filter( 'wpdc_join_discussion_link_html', 'custom_discussion_link', 10, 4 );

```

That new filter will be in the next version. There will be a slight delay in the release due to some logistics, so the next version will be arriving in early October.

---

_[View the full topic](https://meta.discourse.org/t/template-hook-for-discourse-plugin-join-discussion-link-section/323878)._
