1
我有這樣的代碼在WordPress的`delete_post`動作中獲取帖子ID?
add_action('delete_post', 'my_delete_function');
function my_delete_function() {
global $wpdb;
$wpdb->query("
DELETE FROM wp_votes WHERE post=".$thePostID."
;);
}
我怎樣才能得到這個職位的ID被刪除?
此外,如果在管理員中刪除多個帖子,這仍然可行嗎?