CPT with custom datatable insert, update
-
Hello,
I have a CPT with ACF and I have managed to get those fields to save to a custom datatable.
How can I update the same ACF values, with same post_id, while I’m updating the CPT.
Here is what I have done so far.
Now how to update this?add_action('acf/save_post', 'my_acf_save_post'); function my_acf_save_post( $post_ID ) { global $wpdb; $table = $wpdb->prefix.'analiza'; $ime_radnika_1 = get_field('ime_radnika_1', $post_ID); $data = array('post_ID'=>$post_ID,'name' => $ime_radnika_1); $format = array('%d','%s'); $wpdb->insert($table,$data,$format); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘CPT with custom datatable insert, update’ is closed to new replies.