Advertisement
rakeshr

working-options-page

Sep 25th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. <?php
  2. /**
  3.  * AID functions and definitions
  4.  *
  5.  * @package WordPress
  6.  * @subpackage AID
  7.  * @since AID 1.0
  8.  */
  9.  
  10. ?>
  11. <?php
  12. add_action('admin_menu', 'aid_custom_options');
  13. function aid_custom_options()  
  14. {  
  15.     add_menu_page('AID Theme Options', 'Theme Options', 'manage_options', 'functions','aid_options_page');  
  16. }
  17. ?>
  18. <?php  
  19. function aid_options_page()  
  20. {  
  21. ?>  
  22.     <div class="wrap">  
  23.         <h2>Global Options</h2>  
  24.         <form method="post" action="options.php">  
  25.             <?php wp_nonce_field('update-options') ?>  
  26.             <p><strong>Twitter ID:</strong><br />  
  27.                 <input type="text" name="twitterid" size="45" value="<?php echo get_option('twitterid'); ?>" />  
  28.             </p>  
  29.             <p><input type="submit" name="Submit" value="Store Options" /></p>  
  30.             <input type="hidden" name="action" value="update" />  
  31.             <input type="hidden" name="page_options" value="twitterid" />  
  32.         </form>  
  33.     </div>  
  34.    
  35. <?php  
  36. }  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement