حسنًا، أنا مرتبك لماذا يعمل هذا، لأن
ومكونك الإضافي
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 );
ألا تخلط بين معرفات (ووردبريس) $post_id التي تم تمريرها إلى الدالة مع معرف (Discourse) topic_id الذي يعمل كمفتاح مؤقت؟
أتوقع أن يبدو مكونك الإضافي كالتالي:
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 );
من ناحية أخرى، أنت تقول أن هذا يعمل؟ ![]()