Notice: This site requires all users to login before accessing its content. If you do not have a login you may register for one using the register link below.
");
echo("");
echo(get_option('login_screen_message'));
echo("
");
}
function wppassprotect_plugin_menu() {
add_options_page('Password Protect Options', 'Password Protect Plugin', 'administrator', 'wppassprotect', 'wppassprotect_options_page');
}
// wppassprotect_options_page() displays the page content for the Test Options submenu
function wppassprotect_options_page() {
// variables for the field and option names
$opt_name = 'login_screen_message';
$opt_name2 = 'wppassprotect_public_feed';
$hidden_field_name = 'wppassprotect_submit_hidden';
$data_field_name = 'wppassprotect_login_screen_message';
$data_field_name2 = 'wppassprotect_public_feed';
// Read in existing option value from database
$opt_val = get_option( $opt_name );
$opt_val2 = get_option( $opt_name2 );
// See if the user has posted us some information
// If they did, this hidden field will be set to 'Y'
if( $_POST[ $hidden_field_name ] == 'Y' ) {
// Read their posted value
$opt_val = $_POST[ $data_field_name ];
$opt_val2 = $_POST[ $data_field_name2 ];
// Save the posted value in the database
update_option( $opt_name, $opt_val );
update_option( $opt_name2, $opt_val2 );
// Put an options updated message on the screen
?>
';
// header
echo "" . __( 'Password Protect Plugin for WordPress', 'wppassprotect_domain' ) . "
";
// options form
?>