我正在使用wordpress post_updated动作,想知道如何在更新帖子前后比较自定义字段的值?
function check_for_update($post_id, $post_after, $post_before){
if(get_post_meta($post_after, 'custom_field', true)!=get_post_meta($post_before, 'custom_field', true)) {
//do something
}}add_action('check_for_update', 'create_event', 10, 3);