# WP-discourse: how to deal with shortcodes in post

**URL:** <https://meta.discourse.org/t/wp-discourse-how-to-deal-with-shortcodes-in-post/58838>\
**Category:** WordPress\
**Created:** [10.Март.2017 17:15:03 UTC](https://meta.discourse.org/t/wp-discourse-how-to-deal-with-shortcodes-in-post/58838 "2017-03-10T17:15:03Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [12.Сентябрь.2019 16:18:44 UTC](https://meta.discourse.org/t/wp-discourse-how-to-deal-with-shortcodes-in-post/58838/6 "2019-09-12T16:18:44Z")

</div>

Возможно, вам понадобится использовать post\_id, чтобы получить постоянную ссылку. Можете проверить, работает ли что-то вроде этого?

```php
add_filter( 'discourse_publish_format_html', 'wpdc_custom_discourse_publish_format_html', 10, 2 );
function wpdc_custom_discourse_publish_format_html( $output, $post_id ) {
    $permalink = get_the_permalink( $post_id ) . '?embed=true';
    ob_start();
    ?>
    <iframe width="690" height="600" src="<?php echo esc_url( $permalink ); ?>" frameborder="0"></iframe>
    <?php

    return ob_get_clean();
}

```

---

_[View the full topic](https://meta.discourse.org/t/wp-discourse-how-to-deal-with-shortcodes-in-post/58838)._
