Skip to content

Instantly share code, notes, and snippets.

@taniarascia
Created July 29, 2015 18:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taniarascia/27b7746bfa3550f30deb to your computer and use it in GitHub Desktop.
Save taniarascia/27b7746bfa3550f30deb to your computer and use it in GitHub Desktop.
function.php add custom admin are
// Create custom admin area
add_action('admin_menu', 'add_leye_interface');
function add_leye_interface() {
add_options_page('LEYE Custom Fields', 'LEYE Custom Fields', '8', 'functions', 'editleyecustomfields');
}
function editleyecustomfields() {
?>
<div class='wrap'>
<h2>LEYE Custom Fields</h2>
<form method="post" action="options.php">
<?php wp_nonce_field('update-options') ?>
<p><strong>My Name:</strong><br />
<input type="text" name="myname" size="45" value="<?php echo get_option('myname'); ?>" /></p>
<p><strong>Amazon ID:</strong><br />
<input type="text" name="amazonid" size="45" value="<?php echo get_option('amazonid'); ?>" /></p>
<p><strong>Today's Featured Website:</strong><br />
<input type="text" name="todaysite" size="45" value="<?php echo get_option('todaysite'); ?>" /></p>
<p><strong>Welcome Text:</strong><br />
<textarea name="welcomemessage" cols="100%" rows="7"><?php echo get_option('welcomemessage'); ?></textarea></p>
<p><input type="submit" name="Submit" value="Update Options" /></p>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="myname,amazonid,todaysite,welcomemessage" />
</form>
</div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment