false, 'error' => $error, ] ); die(); } /** * Search on multi dimentional array * * @param array $array * @param string $key name of key * @param string $value the value to search * * @return array */ public function search( $array, $key, $value ) { $results = []; if ( is_array( $array ) ) { if ( isset( $array[$key] ) && $array[$key] == $value ) { $results[] = $array; } foreach ( $array as $subarray ) { $results = array_merge( $results, $this->search( $subarray, $key, $value ) ); } } return $results; } /** * Really simple captcha validation * * @return void */ public function validate_rs_captcha() { $nonce = isset( $_REQUEST['wpuf-login-nonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['wpuf-login-nonce'] ) ) : ''; if ( isset( $nonce) && ! wp_verify_nonce( $nonce, 'wpuf_login_action' ) ) { return ; } $rs_captcha_input = isset( $_POST['rs_captcha'] ) ? sanitize_text_field( wp_unslash( $_POST['rs_captcha'] ) ) : ''; $rs_captcha_file = isset( $_POST['rs_captcha_val'] ) ? sanitize_text_field( wp_unslash( $_POST['rs_captcha_val'] ) ) : ''; if ( class_exists( 'ReallySimpleCaptcha' ) ) { $captcha_instance = new ReallySimpleCaptcha(); if ( !$captcha_instance->check( $rs_captcha_file, $rs_captcha_input ) ) { $this->send_error( __( 'Really Simple Captcha validation failed', 'wp-user-frontend' ) ); } else { // validation success, remove the files $captcha_instance->remove( $rs_captcha_file ); } } } /** * reCaptcha Validation * * @return void */ public function validate_re_captcha( $no_captcha = '', $invisible = '' ) { $nonce = isset( $_REQUEST['wpuf-login-nonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['wpuf-login-nonce'] ) ) : ''; if ( isset( $nonce ) && ! wp_verify_nonce( $nonce, 'wpuf_login_action' ) ) { return ; } // need to check if invisible reCaptcha need library or we can do it here. // ref: https://shareurcodes.com/blog/google%20invisible%20recaptcha%20integration%20with%20php $site_key = wpuf_get_option( 'recaptcha_public', 'wpuf_general' ); $private_key = wpuf_get_option( 'recaptcha_private', 'wpuf_general' ); $rremote_addr = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : ''; $g_recaptcha_response = isset( $_POST['g-recaptcha-response'] ) ? sanitize_text_field( wp_unslash( $_POST['g-recaptcha-response'] ) ) : ''; if ( $no_captcha == 1 && 0 == $invisible ) { if ( !class_exists( 'WPUF_ReCaptcha' ) ) { require_once WPUF_ROOT . '/lib/recaptchalib_noCaptcha.php'; } $response = null; $reCaptcha = new WPUF_ReCaptcha( $private_key ); $resp = $reCaptcha->verifyResponse( $rremote_addr, $g_recaptcha_response ); if ( !$resp->success ) { $this->send_error( __( 'noCaptcha reCAPTCHA validation failed', 'wp-user-frontend' ) ); } } elseif ( $no_captcha == 0 && 0 == $invisible ) { $recap_challenge = isset( $_POST['recaptcha_challenge_field'] ) ? sanitize_text_field( wp_unslash( $_POST['recaptcha_challenge_field'] ) ) : ''; $recap_response = isset( $_POST['recaptcha_response_field'] ) ? sanitize_text_field( wp_unslash( $_POST['recaptcha_response_field'] ) ) : ''; $resp = recaptcha_check_answer( $private_key, $rremote_addr, $recap_challenge, $recap_response ); if ( !$resp->is_valid ) { $this->send_error( __( 'reCAPTCHA validation failed', 'wp-user-frontend' ) ); } } elseif ( $no_captcha == 0 && 1 == $invisible ) { $response = null; $recaptcha = isset( $_POST['g-recaptcha-response'] ) ? sanitize_text_field( wp_unslash( $_POST['g-recaptcha-response'] ) ) : ''; $object = new Invisible_Recaptcha( $site_key, $private_key ); $response = $object->verifyResponse( $recaptcha ); if ( isset( $response['success'] ) and $response['success'] != true ) { $this->send_error( __( 'Invisible reCAPTCHA validation failed', 'wp-user-frontend' ) ); } } } /** * Guess a suitable username for registration based on email address * * @param string $email email address * * @return string username */ public function guess_username( $email ) { // username from email address $username = sanitize_user( substr( $email, 0, strpos( $email, '@' ) ) ); if ( !username_exists( $username ) ) { return $username; } // try to add some random number in username // and may be we got our username $username .= rand( 1, 199 ); if ( !username_exists( $username ) ) { return $username; } } /** * Get input meta fields separated as post vars, taxonomy and meta vars * * @param int $form_id form id * * @return array */ public static function get_input_fields( $form_id ) { $form_vars = wpuf_get_form_fields( $form_id ); $ignore_lists = ['section_break', 'html']; $post_vars = $meta_vars = $taxonomy_vars = []; foreach ( $form_vars as $key => $value ) { // ignore section break and HTML input type if ( in_array( $value['input_type'], $ignore_lists ) ) { continue; } //separate the post and custom fields if ( isset( $value['is_meta'] ) && $value['is_meta'] == 'yes' ) { $meta_vars[] = $value; continue; } if ( $value['input_type'] == 'taxonomy' ) { // don't add "category" if ( $value['name'] == 'category' ) { continue; } $taxonomy_vars[] = $value; } else { $post_vars[] = $value; } } return [$post_vars, $taxonomy_vars, $meta_vars]; } public static function prepare_meta_fields( $meta_vars ) { // loop through custom fields // skip files, put in a key => value paired array for later executation // process repeatable fields separately // if the input is array type, implode with separator in a field check_ajax_referer( 'wpuf_form_add' ); $files = []; $meta_key_value = []; $multi_repeated = []; //multi repeated fields will in sotre duplicated meta key foreach ( $meta_vars as $key => $value ) { $value_name = isset( $_POST[$value['name']] ) ? sanitize_text_field( wp_unslash( $_POST[$value['name']] ) ) : ''; if ( isset( $_POST['wpuf_files'][$value['name']] ) ) { $wpuf_files = isset( $_POST['wpuf_files'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_files'][$value['name']] ) ) : []; } else { $wpuf_files = []; } switch ( $value['input_type'] ) { // put files in a separate array, we'll process it later case 'file_upload': case 'image_upload': $files[] = [ 'name' => $value['name'], // 'value' => isset( $wpuf_files[$value['name']] ) ? $wpuf_files[$value['name']] : [], 'value' => isset( $wpuf_files ) ? $wpuf_files : [], 'count' => $value['count'], ]; break; case 'repeat': // if it is a multi column repeat field if ( isset( $value['multiple'] ) && $value['multiple'] == 'true' ) { // if there's any items in the array, process it if ( $value_name ) { $ref_arr = []; $cols = count( $value['columns'] ); $first = array_shift( array_values( $value_name ) ); //first element $rows = count( $first ); // loop through columns for ( $i = 0; $i < $rows; $i++ ) { // loop through the rows and store in a temp array $temp = []; for ( $j = 0; $j < $cols; $j++ ) { $temp[] = $value_name[$j][$i]; } // store all fields in a row with self::$separator separated $ref_arr[] = implode( self::$separator, $temp ); } // now, if we found anything in $ref_arr, store to $multi_repeated if ( $ref_arr ) { $multi_repeated[$value['name']] = array_slice( $ref_arr, 0, $rows ); } } } else { $meta_key_value[$value['name']] = implode( self::$separator, $value_name ); } break; case 'address': if ( is_array( $value_name ) ) { foreach ( $value_name as $address_field => $field_value ) { $meta_key_value[ $value['name'] ][ $address_field ] = sanitize_text_field( $field_value ); } } break; case 'text': case 'email': case 'number': case 'date': $meta_key_value[$value['name']] = sanitize_text_field( trim( $value_name ) ); break; case 'textarea': $meta_key_value[$value['name']] = wp_kses_post( $value_name ); break; case 'map': $data = []; $map_field_data = sanitize_text_field( trim( $value_name ) ); if ( !empty( $map_field_data ) ) { list( $data['address'], $data['lat'], $data['lng'] ) = explode( ' || ', $map_field_data ); $meta_key_value[$value['name']] = $data; } break; default: // if it's an array, implode with this->separator if ( is_array( $value_name ) ) { $acf_compatibility = wpuf_get_option( 'wpuf_compatibility_acf', 'wpuf_general', 'no' ); if ( $value['input_type'] == 'address' ) { $meta_key_value[$value['name']] = $value_name; } elseif ( !empty( $acf_compatibility ) && $acf_compatibility == 'yes' ) { $meta_key_value[$value['name']] = maybe_serialize( $value_name ); } else { $meta_key_value[$value['name']] = implode( self::$separator, $value_name ); } } else { $meta_key_value[$value['name']] = trim( $value_name ); } break; } } //end foreach return [$meta_key_value, $multi_repeated, $files]; } public function guest_fields( $form_settings ) { ?>
  • ' . __( 'Your selected form is no longer available.', 'wp-user-frontend' ) . '' ); return; } if ( $form_status != 'publish' ) { echo wp_kses_post( '
    ' . __( "Please make sure you've published your form.", 'wp-user-frontend' ) . '
    ' ); return; } $form_vars = wpuf_get_form_fields( $form_id ); $form_settings = wpuf_get_form_settings( $form_id ); $label_position = isset( $form_settings['label_position'] ) ? $form_settings['label_position'] : 'left'; $layout = isset( $form_settings['form_layout'] ) ? $form_settings['form_layout'] : 'layout1'; $theme_css = isset( $form_settings['use_theme_css'] ) ? $form_settings['use_theme_css'] : 'wpuf-style'; do_action( 'wpuf_before_form_render', $form_id ); if ( !empty( $layout ) ) { wp_enqueue_style( 'wpuf-' . $layout ); } if ( !is_user_logged_in() && $form_settings['guest_post'] != 'true' ) { echo wp_kses_post( '
    ' . $form_settings['message_restrict'] . '
    ' ); return; } if ( $form_vars ) { ?>
    ', esc_attr( $el_name ), esc_attr( $class_name ), esc_attr( $field_size ),esc_attr( $form_field['label'] ) ); if ( isset( $form_field['input_type'] ) && !in_array( $form_field['input_type'], $label_exclude ) ) { $this->label( $form_field, $post_id ); } } public function render_item_after( $form_field ) { echo wp_kses_post( '' ); } public function conditional_logic( $form_field, $form_id ) { $cond_inputs = $form_field['wpuf_cond']; $cond_inputs['condition_status'] = isset( $cond_inputs['condition_status'] ) ? $cond_inputs['condition_status'] : ''; if ( $cond_inputs['condition_status'] == 'yes' ) { $cond_inputs['type'] = $form_field['input_type']; $cond_inputs['name'] = $form_field['name']; $cond_inputs['form_id'] = $form_id; $condition = json_encode( $cond_inputs ); } else { $condition = ''; } //taxnomy name create unique if ( $form_field['input_type'] == 'taxonomy' ) { $cond_inputs['name'] = $form_field['name'] . '_' . $form_field['type'] . '_' . $form_field['id']; $condition = json_encode( $cond_inputs ); } //for section break if ( $form_field['input_type'] == 'section_break' ) { $cond_inputs['name'] = $form_field['name'] . '_' . $form_field['id']; $condition = json_encode( $cond_inputs ); } ?>
    $form_field ) { // check field visibility options if ( array_key_exists( 'wpuf_visibility', $form_field ) ) { $visibility_selected = $form_field['wpuf_visibility']['selected']; $visibility_choices = $form_field['wpuf_visibility']['choices']; $show_field = false; if ( $visibility_selected == 'everyone' ) { $show_field = true; } if ( $visibility_selected == 'hidden' ) { $form_field['css'] .= ' wpuf_hidden_field'; $show_field = true; } if ( $visibility_selected == 'logged_in' && is_user_logged_in() ) { if ( empty( $visibility_choices ) ) { $show_field = true; } else { foreach ( $visibility_choices as $key => $choice ) { if ( current_user_can( $choice ) ) { $show_field = true; break; } continue; } } } if ( $visibility_selected == 'subscribed_users' && is_user_logged_in() ) { $user_pack = WPUF_Subscription::init()->get_user_pack( get_current_user_id() ); if ( empty( $visibility_choices ) && !empty( $user_pack ) ) { $show_field = true; } elseif ( !empty( $user_pack ) && !empty( $visibility_choices ) ) { foreach ( $visibility_choices as $pack => $id ) { if ( $user_pack['pack_id'] == $id ) { $show_field = true; break; } continue; } } } if ( !$show_field ) { continue; } } // don't show captcha in edit page if ( $post_id && in_array( $form_field['input_type'], $edit_ignore ) ) { continue; } // igonre the hidden fields if ( $form_field['input_type'] == 'hidden' ) { $hidden_fields[] = $form_field; continue; } if ( $form_field['input_type'] != 'step_start' && $form_field['input_type'] != 'step_end' ) { $this->render_item_before( $form_field, $post_id ); } $this->field_count++; switch ( $form_field['input_type'] ) { case 'text': $this->text( $form_field, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'textarea': $this->textarea( $form_field, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'select': $this->select( $form_field, false, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'multiselect': $this->select( $form_field, true, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'radio': $this->radio( $form_field, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'checkbox': $this->checkbox( $form_field, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'url': $this->url( $form_field, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'email': $this->email( $form_field, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'password': $this->password( $form_field, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'taxonomy': $this->taxonomy( $form_field, $post_id, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'section_break': $form_field['name'] = 'section_break'; $this->section_break( $form_field, $post_id, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'html': $form_field['name'] = 'custom_html_' . str_replace( ' ', '_', $form_field['label'] ); $this->html( $form_field, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'image_upload': $this->image_upload( $form_field, $post_id, $type, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; case 'recaptcha': $this->recaptcha( $form_field, $post_id, $form_id ); $this->conditional_logic( $form_field, $form_id ); break; default: // fallback for a dynamic method of this class if exists $dynamic_method = 'field_' . $form_field['input_type']; if ( method_exists( $this, $dynamic_method ) ) { $this->{$dynamic_method}( $form_field, $post_id, $type, $form_id ); } do_action( 'wpuf_render_form_' . $form_field['input_type'], $form_field, $form_id, $post_id, $form_settings ); do_action( 'wpuf_render_pro_' . $form_field['input_type'], $form_field, $post_id, $type, $form_id, $form_settings, 'WPUF_Render_Form', $this, $this->multiform_start, isset( $form_settings['enable_multistep'] ) ? $form_settings['enable_multistep'] : '' ); break; } $this->render_item_after( $form_field ); } //end foreach if ( $hidden_fields ) { foreach ( $hidden_fields as $field ) { printf( '', esc_attr( $field['name'] ), esc_attr( $field['meta_value'] ) ); echo "\r\n"; } } } public function submit_button( $form_id, $form_settings, $post_id ) { ?>
  •  
  • Form Preview
    render_form( $form_id, null ); ?>
    *'; } } /** * Prints HTML5 required attribute * * @param array $attr * * @return string */ public function required_html5( $attr ) { if ( $attr['required'] == 'yes' ) { // echo ' required="required"'; } } /** * Print required class name * * @param array $attr * * @return string */ public function required_class( $attr ) { if ( $attr['required'] == 'yes' ) { echo ' required'; } } /** * Prints form input label * * @param array $attr */ public function label( $attr, $post_id = 0 ) { if ( $post_id && $attr['input_type'] == 'password' ) { $attr['required'] = 'no'; } if ( isset( $attr['input_type'] ) && $attr['input_type'] == 'recaptcha' && $attr['recaptcha_type'] == 'invisible_recaptcha' ) { return; } ?>
    $field; } /** * Prints a text field * * @param array $attr * @param int|null $post_id */ public function text( $attr, $post_id, $type = 'post', $form_id = null ) { // checking for user profile username $username = false; $taxonomy = false; if ( $post_id ) { if ( $this->is_meta( $attr ) ) { $value = $this->get_meta( $post_id, $attr['name'], $type ); } else { // applicable for post tags if ( $type == 'post' && $attr['name'] == 'tags' ) { $post_tags = wp_get_post_tags( $post_id ); $tagsarray = []; foreach ( $post_tags as $tag ) { $tagsarray[] = $tag->name; } $value = implode( ', ', $tagsarray ); $taxonomy = true; } elseif ( $type == 'post' ) { $value = get_post_field( $attr['name'], $post_id ); } elseif ( $type == 'user' ) { $name = $attr['name']; $value = get_user_by( 'id', $post_id )->$name; if ( $attr['name'] == 'user_login' ) { $username = true; } } } } else { $value = $attr['default']; if ( $type == 'post' && $attr['name'] == 'tags' ) { $taxonomy = true; } } ?>
    required_html5( $attr ); ?> name="" placeholder="" value="" size="" /> help_text( $attr ); ?>
    check_word_restriction_func( $attr['word_restriction'], 'no', $attr['name'] . '_' . $form_id ); } } /** * Function to check word restriction * * @param $word_nums number of words allowed */ public function check_word_restriction_func( $word_nums, $rich_text, $field_name ) { // bail out if it is dashboard if ( is_admin() ) { return; } ?> is_meta( $attr ) ) { $value = $this->get_meta( $post_id, $attr['name'], $type, true ); } else { if ( $type == 'post' ) { $value = get_post_field( $attr['name'], $post_id ); } else { $value = $this->get_user_data( $post_id, $attr['name'] ); } } } else { $value = $attr['default']; } ?>
    field_count; $content_css = includes_url() . 'js/tinymce/skins/wordpress/wp-content.css'; if ( $attr['rich'] == 'yes' ) { $editor_settings = [ 'textarea_rows' => $attr['rows'], 'quicktags' => false, 'media_buttons' => false, 'editor_class' => $req_class, 'textarea_name' => $attr['name'], 'tinymce' => [ 'content_css' => $content_css . ', ' . WPUF_ASSET_URI . '/css/frontend-form/' . $layout . '.css', ], ]; $editor_settings = apply_filters( 'wpuf_textarea_editor_args', $editor_settings ); wp_editor( $value, $textarea_id, $editor_settings ); } elseif ( $attr['rich'] == 'teeny' ) { $editor_settings = [ 'textarea_rows' => $attr['rows'], 'quicktags' => false, 'media_buttons' => false, 'teeny' => true, 'editor_class' => $req_class, 'textarea_name' => $attr['name'], 'tinymce' => [ 'content_css' => $content_css . ', ' . WPUF_ASSET_URI . '/css/frontend-form/' . $layout . '.css', ], ]; $editor_settings = apply_filters( 'wpuf_textarea_editor_args', $editor_settings ); wp_editor( $value, $textarea_id, $editor_settings ); } else { ?> help_text( $attr ); ?>
    check_word_restriction_func( $attr['word_restriction'], $attr['rich'], $attr['name'] . '_' . $form_id ); } } /** * Prints a select or multiselect field * * @param array $attr * @param bool $multiselect * @param int|null $post_id */ public function select( $attr, $multiselect = false, $post_id, $type, $form_id = null ) { if ( $post_id ) { $selected = $this->get_meta( $post_id, $attr['name'], $type ); if ( $multiselect ) { if ( is_serialized( $selected ) ) { $selected = maybe_unserialize( $selected ); } elseif ( is_array( $selected ) ) { $selected = $selected; } else { $selected = explode( self::$separator, $selected ); } } } else { $selected = isset( $attr['selected'] ) ? $attr['selected'] : ''; $selected = $multiselect ? ( is_array( $selected ) ? $selected : [] ) : $selected; } $name = $multiselect ? $attr['name'] . '[]' : $attr['name']; $multi = $multiselect ? ' multiple="multiple"' : ''; $data_type = $multiselect ? 'multiselect' : 'select'; $css = $multiselect ? ' class="multiselect wpuf_' . $attr['name'] . '_' . $form_id . '"' : ''; ?>
    help_text( $attr ); ?>
    get_meta( $post_id, $attr['name'], $type, true ); } ?>
    0 ) { foreach ( $attr['options'] as $value => $option ) { ?> help_text( $attr ); ?>
    get_meta( $post_id, $attr['name'], $type, true ) ) { if ( is_serialized( $value ) ) { $selected = maybe_unserialize( $value ); } elseif ( is_array( $value ) ) { $selected = $value; } else { $selected = explode( self::$separator, $value ); } } } ?>
    0 ) { foreach ( $attr['options'] as $value => $option ) { ?> help_text( $attr ); ?>
    is_meta( $attr ) ) { $value = $this->get_meta( $post_id, $attr['name'], $type, true ); } else { //must be user profile url $value = $this->get_user_data( $post_id, $attr['name'] ); } } else { $value = $attr['default']; } ?>
    required_html5( $attr ); ?> name="" placeholder="" value="" size="" /> help_text( $attr ); ?>
    is_meta( $attr ) ) { $value = $this->get_meta( $post_id, $attr['name'], $type, true ); } else { //must be user email $value = $this->get_user_data( $post_id, $attr['name'] ); } } else { $value = $attr['default']; } ?>
    required_html5( $attr ); ?> name="" placeholder="" value="" size="" /> help_text( $attr ); ?>
    required_html5( $attr ); ?> data-repeat="" name="pass1" placeholder="" value="" size="" /> help_text( $attr ); ?>
    ' ); echo wp_kses_post( '
  • ' ); $this->label( ['name' => 'pass2', 'label' => $attr['re_pass_label'], 'required' => $post_id ? 'no' : 'yes'] ); ?>
    required_html5( $attr ); ?> name="pass2" value="" placeholder="" size="" />
    ' ); echo wp_kses_post( '
  • ' ); wp_enqueue_script( 'zxcvbn' ); wp_enqueue_script( 'password-strength-meter' ); ?>
     
    __( '-- Select --', 'wp-user-frontend' ), 'hierarchical' => 1, 'hide_empty' => 0, 'orderby' => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name', 'order' => isset( $attr['order'] ) ? $attr['order'] : 'ASC', 'name' => $taxonomy . '[]', 'taxonomy' => $taxonomy, 'echo' => 0, 'title_li' => '', 'class' => 'cat-ajax ' . $taxonomy . $class, $exclude_type => $exclude, 'selected' => $selected, 'depth' => 1, 'child_of' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '', ]; $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args ); $select = wp_dropdown_categories( $tax_args ); echo wp_kses_post( str_replace( ' $attr['required'], 'name' => $attr['name'], 'exclude_type' => $attr['exclude_type'], 'exclude' => isset( $attr['exclude'] ) ? $attr['exclude'] : '', 'orderby' => $attr['orderby'], 'order' => $attr['order'], //'last_term_id' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '', //'term_id' => $selected ]; $attr = apply_filters( 'wpuf_taxonomy_checklist_args', $attr ); ?> > 'names'] ); } elseif ( $post_id ) { $terms = wp_get_post_terms( $post_id, $taxonomy, ['fields' => 'ids'] ); } if ( !taxonomy_exists( $taxonomy ) ) { echo wp_kses_post( '
    ' . __( 'This field is no longer available.', 'wp-user-frontend' ) . '
    ' ); return; } $div_class = 'wpuf_' . $attr['name'] . '_' . $attr['type'] . '_' . $attr['id'] . '_' . $form_id; ?>
    taxnomy_select( null, $attr, $form_id ); ?>
    taxnomy_select( $term_id, $attr ); ?>
    isset( $attr['first'] ) ? $attr['first'] : '--select--', 'hierarchical' => 1, 'hide_empty' => 0, 'orderby' => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name', 'order' => isset( $attr['order'] ) ? $attr['order'] : 'ASC', 'name' => $taxonomy . '[]', 'taxonomy' => $taxonomy, 'echo' => 0, 'title_li' => '', 'class' => $taxonomy . $class, $exclude_type => $exclude, 'selected' => $selected, ]; $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args ); $select = wp_dropdown_categories( $tax_args ); echo wp_kses_post( str_replace( ' __( '-- Select --', 'wpuf' ), 'hierarchical' => 1, 'hide_empty' => 0, 'orderby' => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name', 'order' => isset( $attr['order'] ) ? $attr['order'] : 'ASC', 'name' => $taxonomy . '[]', 'id' => 'cat-ajax', 'taxonomy' => $taxonomy, 'echo' => 0, 'title_li' => '', 'class' => $taxonomy . ' multiselect' . $class, $exclude_type => $exclude, 'selected' => $selected, 'walker' => $walker, ]; $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args ); $select = wp_dropdown_categories( $tax_args ); echo wp_kses_post( str_replace( ' required_html5( $attr ) ); ?> name="" value="" size="40" /> help_text( $attr ); ?>
    is_meta( $attr ) ) { $images = $this->get_meta( $post_id, $attr['name'], $type, false ); if ( $images ) { if ( is_serialized( $images[0] ) ) { $images = maybe_unserialize( $images[0] ); } if ( is_array( $images[0] ) ) { $images = $images[0]; } } $has_images = true; } else { if ( $type == 'post' ) { // it's a featured image then $thumb_id = get_post_thumbnail_id( $post_id ); if ( $thumb_id ) { $has_featured_image = true; $featured_image = WPUF_Upload::attach_html( $thumb_id, 'featured_image' ); } } else { // it must be a user avatar $has_avatar = true; $featured_image = get_avatar( $post_id ); } } } $button_label = empty( $attr['button_label'] ) ? __( 'Select Image', 'wp-user-frontend' ) : $attr['button_label']; ?>
      ' . $featured_image ); printf( '
      %s', esc_html( __( 'Are you sure?', 'wp-user-frontend' ) ),esc_html( __( 'Delete', 'wp-user-frontend' ) ) ); echo wp_kses_post( '' ); } } if ( $has_images ) { foreach ( $images as $attach_id ) { echo esc_attr( WPUF_Upload::attach_html( $attach_id, $attr['name'] ) ); } } ?>
    help_text( $attr ); ?>

    data-callback="onSubmit" data-size="invisible">