# WP Discourse: advanced custom filter for discourse\_publish\_format\_html

**URL:** https://meta.discourse.org/t/wp-discourse-advanced-custom-filter-for-discourse-publish-format-html/106059
**Category:** WordPress
**Created:** [January 9, 2019, 2:35pm UTC](https://meta.discourse.org/t/wp-discourse-advanced-custom-filter-for-discourse-publish-format-html/106059 "2019-01-09T14:35:02Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Kayla](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kayla/32/128523_2.png) [@Kayla](https://meta.discourse.org/u/Kayla)
#### Post date: [January 9, 2019, 2:37pm UTC](https://meta.discourse.org/t/wp-discourse-advanced-custom-filter-for-discourse-publish-format-html/106059/2 "2019-01-09T14:37:41Z")

</div>

I’m a new user, so I got a message I had too many links in my post, so

Link 1:

> [@WP-discourse: how to deal with shortcodes in post](https://meta.discourse.org/t/wp-discourse-how-to-deal-with-shortcodes-in-post/58838/4):
>
> For posts where you need the shortcode content to be published to Discourse, it’s possible to publish the post in an iframe. This works best if the WordPress posts uses a custom post-type. That way you can decide which posts are to be published in an iframe. It takes a bit of work on the WordPress end so that posts are published in a format that’s suitable for putting in an iframe. You also need to be able to whitelist the iframe on Discourse for this to work. I’ve been testing this with both a…

Link 2:

> [@How to pass custom field types and taxonomies to the WordPress plugin?](https://meta.discourse.org/t/how-to-pass-custom-field-types-and-taxonomies-to-the-wordpress-plugin/77817/2):
>
> Yes. You can customize the discourse\_publish\_format\_html template for a specific post type. See this topic for more details about customizing the templates: [Customize the structure of WP Discourse templates](https://meta.discourse.org/t/wp-discourse-template-customization/50754) Something like this, added to a plugin, or to your theme’s functions.php file should work. You can use the following tags in the template: {excerpt}, {blogurl}, {author}, {thumbnail}, {featuredimage} add\_filter( 'discourse\_publish\_format\_html', 'wpdc\_custom\_discourse\_publish\_format\_html' …

Link 3:  
[https://meta.discourse.org/t/wp-discourse-template-customization/50754/13](https://meta.discourse.org/t/wp-discourse-template-customization/50754/13)

---

_[View the full topic](https://meta.discourse.org/t/wp-discourse-advanced-custom-filter-for-discourse-publish-format-html/106059)._
