قم بإرسال الصورة المميزة من ووردبريس إلى ديسكورد بحيث يؤدي النقر على الصورة في ديسكورد إلى العودة إلى منشور ووردبريس. إليك ما يعمل معي. أتمنى أن يساعد:
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>نُشر في الأصل على: {blogurl}</small><br>
<?php echo $title ?><br>
<?php echo $image ?>
<?php $output = ob_get_clean();
return $output;
} ?>