음, 이게 왜 동작하는지 혼란스럽네요.
그리고 당신의 플러그인은 다음과 같습니다.
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와 트랜지언트 키로 사용되는 (디스커스) 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 );
하지만 당신은 이것이 동작한다고 말하고 있네요? ![]()