Created
September 9, 2016 15:26
-
-
Save thebigtine/cca0833fb29ea2a9ee887c2fa094062d to your computer and use it in GitHub Desktop.
This file contains 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
add_filter('admin_init', 'msf_general_settings_register_fields'); | |
function msf_general_settings_register_fields() | |
{ | |
register_setting('general', 'homepage_image', 'esc_attr'); | |
add_settings_field('homepage_image', '<label for="homepage_image">'.__('Homepage Header Image' , 'homepage_image' ).'</label>' , 'msf_general_settings_fields_html', 'general'); | |
} | |
function msf_general_settings_fields_html() | |
{ | |
$value = get_option( 'homepage_image', '' ); | |
echo '<input class="regular-text" type="url" id="homepage_image" name="homepage_image" value="' . $value . '" />'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment