public static function save($post_id, $post) { if (isset($_POST['assign_to'])) { rtbiz_update_entity_meta($post_id, 'assgin_to', $_POST['assign_to']); } else { rtbiz_update_entity_meta($post_id, 'assgin_to', ''); } }
/** * create contact * * @param $name * @param string $description * @param string $email * * @return int|WP_Error */ function add_contact($name, $description = '', $email = '') { $contact_id = wp_insert_post(array('post_title' => $name, 'post_excerpt' => $description, 'post_type' => $this->post_type, 'post_status' => 'publish')); if (!empty($email)) { rtbiz_update_entity_meta($contact_id, self::$primary_email_key, $email); } return $contact_id; }