/** * Global Utilities * */ function get_city($s_id) { if (!$s_id) return; // if (function_exists(‘get_field_object’)) { if ($s_id && get_post_type($s_id) == ‘show’) { $post_id = $s_id; } elseif ($s_id && function_exists(‘get_field’) && get_field(‘show_relationship’, $s_id)) { $post_id = get_field(‘show_relationship’, $s_id)[0]; }…Continue reading
//add_shortcode(‘show-at’, ‘show_at’); //function show_at($atts, $content) //{ // if (isset($atts[‘size’])) { // $class = ‘ class=” ‘ . $atts[‘size’] . ‘ “‘; // } else { // $class = ”; // }; // return ‘‘ . $content . ‘‘; //} add_shortcode(‘start-bold’,…Continue reading
// this is the class definition class myfair_Show_Data { public function __construct() { $this->loadShows(); if (isset($this->showList) && is_array($this->showList) && count($this->showList) > 0) { $this->loadShowCustomData(); } } public function loadShows() { $loop = new WP_Query(array( ‘post_type’ => ‘show’, ‘post_parent’ => ‘0’,…Continue reading
function get_city_field( $user_id = null, $role = null, $required = null, $readonly = null) { $field[‘name’] = ‘_city’; $field[‘label’] = ‘City’; $field[‘key’] = ‘city’; // // if( $user_id && in_array(‘exhibitor’, get_userdata( $user_id )->roles )){ // $field[‘label’] = ‘Gallery City’; //…Continue reading
function process_booth_id($_Cid){ $booth_dirty = get_field(‘booth_id’, $_Cid); if($booth_dirty === null || $booth_dirty === false || $booth_dirty === ” || $booth_dirty === ‘select’) return false; if(sanitize_title(trim($booth_dirty)) == ‘pending’) return ‘Pending’; $resp = []; $resp[‘full’] = $booth_dirty; $booth_dirty_arr = explode(‘_’, $booth_dirty); $resp[‘int’] =…Continue reading
function get_gallery_bdf_items($post_id){ $resp = array(); $sum = 0; $resp[‘gallery’] = get_userdata(get_post_field(‘post_author’, $post_id))->display_name; if (have_rows(‘booth_items’, $post_id)) while (have_rows(‘booth_items’, $post_id)) { the_row(); // var_dump(get_sub_field(‘price_tier’) == ‘complimentary’ || get_sub_field(‘price_tier’) == ‘included’); $id = get_sub_field(‘id’); if(get_sub_field(‘price_tier’) != ‘complimentary’ && get_sub_field(‘price_tier’) != ‘included’) { $resp[$id][]…Continue reading
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