Custom Field Not working with WordPress hooks
-
Hello,
I’ve used a hook named as save_post which run when post is updated or published, but this hook does not getting value from custom meta box. Here is My code, Can someone help with that?
add_action('save_post','save_floorplan_property_callback',10,3); function save_floorplan_property_callback($post_id, $post, $update){ global $wpdb; if ($post->post_type != 'property'){ return; } $floorplan = get_field( 'find_on_the_ground', $post_id ); if($floorplan == "No"){ //do something } else { //do something } }Default Value is No and it always go in No Condition.
Thanks
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Custom Field Not working with WordPress hooks’ is closed to new replies.