Contar_Elementos_telefono

/* * Check the single line text field for profanity. * * @link https://wpforms.com/developers/wpforms_process_validate_text/ * * @param int $field_id Field ID. * @param array $field_submit Unsanitized field value submitted for the field. * @param array $form_data Form data and settings.…Continue reading

Modificar_Familiar

function wpf_snip_Modify_Familiar_process_complete( $fields, $entry, $form_data, $entry_id ) { // form #15755. if ( absint( $form_data[‘id’] ) !== 15755 ) { error_log(“Id form no encontrado”); return; } $user_id = get_current_user_id(); if ($user_id == 0){ error_log( ‘Unable to get user id!’ );…Continue reading

Agregar Miembro

function wpf_snip_StoreData_UserDB_process_complete( $fields, $entry, $form_data, $entry_id ) { // form #12330. if ( absint( $form_data[‘id’] ) !== 12330 ) { error_log(“Id form no encontrado”); error_log($form_data[‘id’]); return; } $user_id = get_current_user_id(); if ($user_id == 0){ error_log( ‘Unable to get user id!’…Continue reading

Agregar Familiar

function wpf_snip_StoreData_FamiliarUserDB_process_complete( $fields, $entry, $form_data, $entry_id ) { // form #12330. if ( absint( $form_data[‘id’] ) !== 12546 ) { error_log(“Id form no encontrado”); return; } $user_id = get_current_user_id(); if ($user_id == 0){ error_log( ‘************************************************************’ ); error_log( ‘No obtuvo el…Continue reading

MFP > Global Utilities

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

MFP > Shortcodes

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

MFP > CLASS > myfair_Show_Data

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

MFP > Form Fields

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

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