WP-discourse: how to deal with shortcodes in post

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

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();
}