' ); if ( is_user_logged_in() ) { $user = get_user_by( 'id', get_current_user_id() ); $contact = new BWFCRM_Contact( $user->user_email ); /** Get DOB from contact */ $dob = $contact->get_field_by_slug( 'dob' ); /** Get Dob from user meta */ $user_dob = get_user_meta( get_current_user_id(), 'bwfan_birthday_date', true ); $birthday_date = empty( $dob ) ? $user_dob : $dob; if ( ! empty( $birthday_date ) ) { $date_parts = explode( '-', $birthday_date ); if ( count( $date_parts ) === 3 ) { $selected_year = $date_parts[0]; $selected_month = $date_parts[1]; $selected_date = $date_parts[2]; } } $hide_field = ! empty( $global_settings['bwfan_hide_dob_field'] ) && ! empty( $birthday_date ); if ( is_account_page() && ! empty( $hide_field ) ) { BWFAN_Birthday::show_birthday_on_my_profile( $user ); } // If field should be hidden on account page, don't display anything if ( $hide_field ) { return; } if ( ! $use_dropdown_ui ) { $max = BWFAN_PRO_Common::get_birthday_max_value(); $min = BWFAN_PRO_Common::get_birthday_min_value(); $input_args = 'type=date'; $placeholder = ''; if ( 'wfacp-modern-label' === $label_position ) { if ( empty( $birthday_date ) ) { $input_args = 'type=text'; } $input_args .= ' onfocus="(this.type=\'date\')" onblur="(this.value == \'\' ? this.type=\'text\' : \'\')"'; $placeholder = ! empty( $placeholder_label ) ? $placeholder_label : $birthday_label; } } } /** If year, month and day are empty */ if ( empty( $selected_year ) && empty( $selected_date ) && empty( $selected_month ) && ! is_null( WC()->session ) ) { $selected_year = WC()->session->get( 'bwfan_birthday_date_yy', '' ); $selected_date = WC()->session->get( 'bwfan_birthday_date_dd', '' ); $selected_month = WC()->session->get( 'bwfan_birthday_date_mm', '' ); } $dob_class = ''; if ( $use_dropdown_ui ) { $dob_class = 'bwfan-dob-wrapper'; } if ( empty( $wfacp_id ) && ! empty( $required ) ) { $class .= " validate-required"; } ?>

class="input-text " name="bwfan_birthday_date" id="bwfan_birthday_date" placeholder="" value="" >