0,
'ageverify_background' => '',
'ageverify_logoselect' => '',
'ageverify_logoheight' => '50',
'ageverify_template' => 'opaque',
'ageverify_underageredirect' => 'https://ageverify.com',
'ageverify_prompttext' => __( 'Welcome! Please verify
your age to enter.
Are you 21 years or older?', 'ageverify' ),
'ageverify_fontsize' => '24',
'ageverify_entertext' => __( 'Yes', 'ageverify' ),
'ageverify_exittext' => __( 'No', 'ageverify' ),
'ageverify_bfontsize' => '22',
'ageverify_yytext' => 'YYYY',
'ageverify_mmtext' => 'MM',
'ageverify_ddtext' => 'DD',
'ageverify_remembertext' => __( 'Remember Me', 'ageverify' ),
'ageverify_colorp' => '007000',
'ageverify_colors' => 'ffffff',
'ageverify_age' => '21',
'ageverify_method' => 'avp',
'ageverify_countup' => 0,
'ageverify_altbackground' => 'none',
'ageverify_altlogo' => 'none'
);
$options = get_option('ageverify_settings');
return wp_parse_args( $options, $defaults );
}
function ageverify_add_defaults() {
$tmp = get_option( 'ageverify_settings' );
if ( ! is_array( $tmp ) ) {
$arr = ageverify_get_options_with_defaults();
update_option( 'ageverify_settings', $arr );
}
}
// ------------------------------------------------------------------------------
// CALLBACK FUNCTION FOR: add_action('admin_init', 'ageverify_init' )
// ------------------------------------------------------------------------------
// THIS FUNCTION RUNS WHEN THE 'admin_init' HOOK FIRES, AND REGISTERS YOUR PLUGIN
// SETTING WITH THE WORDPRESS SETTINGS API. YOU WON'T BE ABLE TO USE THE SETTINGS
// API UNTIL YOU DO.
// ------------------------------------------------------------------------------
// Init plugin options to white-list our options.
function ageverify_init(){
register_setting( 'ageverify_plugin_options', 'ageverify_settings', 'ageverify_validate_options' );
}
// ------------------------------------------------------------------------------
// CALLBACK FUNCTION FOR: add_action('admin_menu', 'ageverify_add_options_page');
// ------------------------------------------------------------------------------
// Add menu page
function ageverify_add_options_page() {
add_menu_page(
'AgeVerify',
'AgeVerify',
'manage_options',
'age-verify-options',
'ageverify_render_options_page',
plugin_dir_url( __FILE__ ) . '/includes/AVicon20.png',
85.420
);
}
// ------------------------------------------------------------------------------
// CALLBACK FUNCTION SPECIFIED IN: add_options_page()
// ------------------------------------------------------------------------------
add_action( 'admin_init', 'ageverify_settings_init' );
function ageverify_settings_init( ) {
register_setting( 'pluginPage', 'ageverify_settings' );
register_setting( 'customize', 'ageverify_settings' );
register_setting( 'moreFromImbibeDigital', 'ageverify_settings' );
add_settings_section(
'ageverify_pluginPage_section',
'',
'ageverify_settings_section_callback',
'pluginPage'
);
add_settings_field(
'ageverify_on',
__( 'Enable or Disable AgeVerify', 'ageverify' ),
'ageverify_on_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_background',
'',
'ageverify_background_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_template',
'',
'ageverify_template_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_prompttext',
__( 'Age Verification Prompt Text', 'ageverify' ),
'ageverify_prompttext_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_fontsize',
__( 'Prompt Text Font Size', 'ageverify' ),
'ageverify_fontsize_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_method',
__( 'Select Age Verification Method', 'ageverify' ),
'ageverify_method_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_entertext',
__( 'Enter Button Text', 'ageverify' ),
'ageverify_entertext_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_exittext',
__( 'Exit Button Text', 'ageverify' ),
'ageverify_exittext_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_bfontsize',
__( 'Button Text Font Size', 'ageverify' ),
'ageverify_bfontsize_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_yytext',
__( 'Birth Year Input Placeholder Text', 'ageverify' ),
'ageverify_yytext_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_mmtext',
__( 'Birth Month Input Placeholder Text', 'ageverify' ),
'ageverify_mmtext_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_ddtext',
__( 'Birth Day Input Placeholder Text', 'ageverify' ),
'ageverify_ddtext_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_age',
__( 'Minimum Age for Entry', 'ageverify' ),
'ageverify_age_render',
'pluginPage',
'ageverify_pluginPage_section'
);
add_settings_field(
'ageverify_remembertext',
__( 'Remember Me Text', 'ageverify' ),
'ageverify_remembertext_render',
'pluginPage',
'ageverify_pluginPage_section'
);
// customize tab
add_settings_section(
'ageverify_customize_section',
'',
'ageverify_customize_section_callback',
'customize'
);
// More from Imbibe Digital tab
add_settings_section(
'ageverify_moreFromImbibeDigital_section',
'',
'ageverify_moreFromImbibeDigital_section_callback',
'moreFromImbibeDigital'
);
}
function ageverify_on_render() {
$options = ageverify_get_options_with_defaults();
?>
value='1'
>