Created
April 28, 2018 00:19
-
-
Save ahmedmusawir/c305d4c3e7d6cd4dd62429193b4a58da to your computer and use it in GitHub Desktop.
WP-PLUGINS - ENTRY FOR SETTINGS GENERAL ONLY - FOOTER MESSAGE
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
/** | |
* | |
* Just the general settings | |
* | |
*/ | |
function demo_init_theme_options() { | |
// Define the settings field | |
add_settings_field( | |
'footer_message', //The ID (or the name) of the field | |
'Theme Footer Message', //The Label | |
'demo_footer_message_display', //The Callback | |
'general' //The section where we add this | |
); | |
// Register the 'footer_message' setting with the 'General' section | |
register_setting( | |
'general', | |
'footer_message' | |
); | |
} | |
add_action( 'admin_init', 'demo_init_theme_options' ); | |
function demo_footer_message_display() | |
{ | |
?> | |
<input type="text" name="footer_message" id="footer_message" value="<?php echo get_option( 'footer_message' ); ?>" /> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment