WordPress.org

Ready to get started?Download WordPress

Forums

Age Verify
[resolved] Placeholder for Dropdown (2 posts)

  1. zeevee1
    Member
    Posted 10 months ago #

    Awesome plugin, highly recommended!!!

    Question:
    How can I define a place holder for dropdown calendar so the default values are "Month", "Date" and "Year" not January, 01 and current year? I guess we have to put Month, Date and Year and the list value and selected but I am not sure how?

    http://wordpress.org/plugins/age-verify/

  2. zeevee1
    Member
    Posted 10 months ago #

    Well I think the support is dead for this plugin, but I have an answer if somebody else is trying to implement this:

    functions.php, Line 325

    case 'dropdowns' :
    $form.='<p><select name="av_verify_m" id="av_verify_m">';
    $form.='<option value="" disabled selected>Month</option>';
    foreach ( range( 1, 12 ) as $month ) :
    $month_name = date( 'F', mktime( 0, 0, 0, $month, 1 ) );
    $form .= '<option value="' . $month . '">' . $month_name . '</option>';

    endforeach;

    $form .= '</select> - <select name="av_verify_d" id="av_verify_d">';
    $form.='<option value="" disabled selected>Date</option>';
    foreach ( range( 1, 31 ) as $day ) :
    $form .= '<option value="' . $day . '">' . esc_html( zeroise( $day, 2 ) ) . '</option>';

    endforeach;

    $form .= '</select> - <select name="av_verify_y" id="av_verify_y">';
    $form.='<option value="" disabled selected>Year</option>';
    foreach ( range( 1910, date( 'Y' ) ) as $year ) :
    $selected = ( $year == date( 'Y' ) ) ? 'selected="selected"' : '';
    $form .= '<option value="' . $year . '">' . $year . '</option>';

    endforeach;

    $form .= '</select></p>';

    break;

Reply

You must log in to post.

About this Plugin

About this Topic

Tags