function process_booth_status($_Cid){ $resp = []; $booth_data = process_booth_id($_Cid); if(!is_array($booth_data)) { $resp[‘status’] = ‘pending’; } if(is_array($booth_data) && !check_e_status(‘Booth Design Operations’, $_Cid)){ $resp[‘status’] = ‘build’; } if (is_array($booth_data) && check_e_status(‘Booth Design Operations’, $_Cid) && !check_e_status(‘Booth Design Curatorial’, $_Cid)) { $resp[‘status’] = ‘operations’;…Continue reading
// add_filter(‘acf/load_field/key=field_5b5e1e63ffa7d’, ‘process_booth_select_field’, 30); function process_booth_select_field($field) { global $post; if (!is_admin() || get_post_type($post->ID) != ‘application’) return $field; $s_id = get_field(‘show_relationship’, $post->ID)[0]; if (count($field) > 0) { $loop = get_posts(array( ‘post_status’ => array(‘private’), ‘post_type’ => array(‘application’), ‘posts_per_page’ => ‘-1’, ‘meta_query’ =>…Continue reading
function get_processed_booth_data($_Cid = null, $sq_ft = null) { // if(!get_field(‘booth_size’, $_Cid) || !get_field(‘booth_size’, $_Cid)) return; $currency = ‘$’; if($_Cid){ $s_id = get_field(‘show_relationship’, $_Cid)[0]; } else { global $post; $s_id = $post->post_parent; } if ($sq_ft !== null && $s_id !== null)…Continue reading
function get_processed_booth_data($_Cid = null, $sq_ft = null) { // if(!get_field(‘booth_size’, $_Cid) || !get_field(‘booth_size’, $_Cid)) return; $currency = ‘$’; if($_Cid){ $s_id = get_field(‘show_relationship’, $_Cid)[0]; } else { global $post; $s_id = $post->post_parent; } if ($sq_ft !== null && $s_id !== null)…Continue reading
add_filter(‘acf/load_field/name=booth_id’, ‘populate_booth_id_array’, 20, 1); function populate_booth_id_array($field) { global $post; if (!$post instanceof WP_Post || !is_admin()) return $field; $s_id = null; if (get_post_type($post->ID) == ‘show’) { $s_id = $post->ID; } elseif (get_post_type($post->ID) == ‘application’) { $s_id = get_field(‘show_relationship’, $post->ID)[0]; } else…Continue reading
function get_booth_ids_from_svg($s_id) { $svgData = get_field(‘svg_floorplan_file’, $s_id); $dom = new DOMDocument(); $html = ‘ ‘; $result = ‘ The data included in this document is from www.openstreetmap.org. The data is made available under ODbL. ‘; $doc = new DOMDocument; $doc->loadXML($result);…Continue reading
add_action( ‘save_post_show’, ‘save_post_show_default’, 1, 3); function save_post_show_default( $post_id, $post, $update ) { if( is_a( $post, ‘\WP_Post’ ) && ‘auto-draft’ == $post->post_status && post_type_supports( $post->post_type, ‘custom-fields’ ) && ‘0000-00-00 00:00:00’ == $post->post_date_gmt && $post_id > 0 && ! $update ) {…Continue reading
add_action(‘acf/init’, ‘acf_init_google_api_key’); function acf_init_google_api_key() { acf_update_setting(‘google_api_key’, ‘AIzaSyAN_UuSnJqi4C4cinccmoHtK619hGptrbc’); }Continue reading
add_action(‘acf/save_post’, ‘add_show_children’); function add_show_children($post_id) { if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return $post_id; if (!wp_is_post_revision($post_id) && ‘show’ == get_post_type($post_id) && ‘auto-draft’ != get_post_status($post_id) && ‘draft’ == get_post_status($post_id) ) { if (0 == get_post($post_id)->post_parent) { $countInt = (int) 1; $count = (string) $countInt;…Continue reading