Hmm, je ne comprends pas pourquoi cela fonctionne, car
Et votre plugin
add_action( 'wpdc_after_webhook_post_update', function( $topic_ids ) {
foreach ( (array)$topic_ids as $topic_id ) {
delete_transient( 'wpdc_comment_html_' . $topic_id );
}
}, 11 );
Ne mélangez-vous pas les $post_id (Wordpress) passés à l’action avec le topic_id (Discourse) qui sert de clé de transient ?
Je m’attendrais à ce que votre plugin ressemble à ceci :
add_action( 'wpdc_after_webhook_post_update', function( $post_ids) {
foreach ( (array)$post_ids as $post_id ) {
$topic_id = get_post_meta( $post_id, 'discourse_topic_id', true );
delete_transient( 'wpdc_comment_html_' . $topic_id );
}
}, 11 );
D’un autre côté, vous dites que cela fonctionne ? ![]()