-
-
Save taniarascia/5b3d9bfa6300a9018a3a265113960645 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Forged Settings | |
function forged_settings_add_options(){ | |
add_options_page( 'Forged Settings', 'Forged Settings', 'manage_options', 'forged-settings', 'forged_settings_page'); | |
} | |
add_action( 'admin_menu', 'forged_settings_add_options'); | |
//Create Forged Settings Submenu | |
function forged_settings_page(){ ?> | |
<div class = "wrap"> | |
<h1>Forged Theme Settings</h1> | |
<form method="post" action="options.php"> | |
<?php | |
settings_fields( 'section' ); | |
do_settings_section ('theme-options'); | |
submit_button(); | |
?> | |
</form> | |
</div> | |
<?php } | |
function setting_twitter() { ?> | |
<input type="text" name="twitter" value="<?php echo get_option( 'twitter' ); ?>" /> | |
<?php } | |
function forged_settings_page_setup(){ | |
add_settings_section( 'section', 'All Settings', null, 'theme-options'); | |
add_settings_field( 'twitter', 'Twitter URL', 'setting_twitter', 'theme-options', 'section'); | |
register_setting('section', 'twitter'); | |
} | |
add_action( 'admin_init', 'forged_settings_page_setup'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment