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

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.

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)

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.

1 Like