Create the actual admin page
-
I have the menu setup but I help with creating the admin page. I get includes errors with this…
<?php //must check that the user has the required capability if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } // variables for the field and option names $opt_name = mysql_real_escape_string($_POST['name']); $hidden_field_name = 'mt_submit_hidden'; $data_field_name = 'name'; // See if the user has posted us some information // If they did, this hidden field will be set to 'Y' if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) { // Read their posted value $opt_val = $_POST[ $data_field_name ]; // Save the posted value in the database // Put an settings updated message on the screen ?> <div class="updated"><p><strong><?php _e('settings saved.', 'menu-test' ); ?></strong></p></div> <?php } // Now display the settings editing screen echo '<div class="wrap">'; // settings form ?> <form name="form1" method="post" action=""> <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y"> <p> <input type="text" name="<?php echo $data_field_name; ?>" value="<?php echo $opt_val; ?>" size="50"> </p><hr /> <p class="submit"> <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" /> </p> </form> </div>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Create the actual admin page’ is closed to new replies.