update_post_meta not working in action hook
Firstly, init hook doesn’t supply $post_id as an argument. Secondly, you have miss-matched variable name – $postid & $post_id Here’s the revised code – function get_fields_company_profile() { if( isset($_GET[‘post’]) && ” != $_GET[‘post’] && isset($_GET[‘action’]) && ‘edit’ == $_GET[‘action’] && ( !isset($_GET[‘post_type’]) || ‘post’ == $_GET[‘post_type’] ) ){ global $wpdb; $postid = (int) $_GET[‘post’]; $row … Read more