0210 > process_booth_id

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

0260 > get_gallery_bdf_items

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

0230 > process_booth_status ???? get status for admin app

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

0220 > process_booth_select_field > DUPLICATEE? populate booth id select

// 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

0250 > get_processed_booth_data WORK ON

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

MFP > get_processed_booth_data WORK ON

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

0270 > Get IDs from SVG

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

MFP > ACF Google API Key

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

ACF Do Shortcode Filter

add_filter(‘acf/format_value/type=text’, ‘acf_do_shortcode’, 10, 3); add_filter(‘acf/format_value/type=textarea’, ‘acf_do_shortcode’, 10, 3); function acf_do_shortcode($value, $post_id, $field) { if (is_admin()) { return $value; } return apply_filters(‘the_content’, $value); }Continue reading

PHP: Render User Gallery [user_gallery] V1

function render_user_gallery() { if (!is_user_logged_in()) { error_log(“[GALLERY] User not logged in.”); return ‘ You must be logged in to view your gallery. ‘; } // Retrieve user info and directories $current_user = wp_get_current_user(); $user_id = $current_user->ID; $upload_dir = wp_upload_dir(); $user_dir…Continue reading