Hmm, sono confuso sul perché questo funzioni, perché
E il tuo 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 );
Non stai confondendo gli $post_id (di Wordpress) passati all’azione con il topic_id (di Discourse) che funge da chiave per il transient?
Mi aspetterei che il tuo plugin fosse così:
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’altra parte, stai dicendo che questo funziona? ![]()