Envoyez votre image mise en avant depuis WordPress vers Discourse afin que le clic sur l’image dans Discourse vous ramène à l’article WordPress. Voici ce qui fonctionne pour moi. J’espère que cela vous aidera :
add_filter( 'discourse_publish_format_html', 'my_custom_publish_format', 10, 2 );
function my_custom_publish_format( $output, $post_id ) {
$post = get_post( $post_id );
$title = get_the_title($post->ID);
$url = get_permalink($post->ID);
if ( has_post_thumbnail( $post_id ) ) {
$image = ' [ . ')](' . $url . ')' ;
} else {
$image = "";
} ?>
<?php ob_start(); ?>
<small>Publié à l'origine sur : {blogurl}</small><br>
<?php echo $title ?><br>
<?php echo $image ?>
<?php $output = ob_get_clean();
return $output;
} ?>