/** * Find out what type of field the user asks for. * */ static function get_field_type($meta_name = false, $field_name = false) { // get all CFC's $args = array('post_type' => 'wck-meta-box', 'posts_per_page' => -1, 'post_status' => array('publish'), 'fields' => 'ids'); $all_cfc = get_posts($args); foreach ($all_cfc as $post_id) { $queried_meta_name = WCK_Template_API::get_meta('wck_cfc_args', $post_id); $queried_meta_name = $queried_meta_name[0]['meta-name']; if ($meta_name == $queried_meta_name) { $available_fields = WCK_Template_API::get_meta('wck_cfc_fields', $post_id); foreach ($available_fields as $key => $field_data) { $current_field = WCK_Template_API::generate_slug($field_data['field-title']); if ($current_field == $field_name) { return $field_data['field-type']; } } } } return 'text'; }
function get_cfc_meta($meta_name = false, $post_id = false) { return WCK_Template_API::get_meta($meta_name, $post_id); }