WP-discourse: how to deal with shortcodes in post

Il se peut que vous ayez besoin d’utiliser l’identifiant de publication (post_id) pour obtenir le lien permanent. Pouvez-vous vérifier si quelque chose comme ceci fonctionne ?

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