Last active
September 15, 2018 09:41
-
-
Save Titoratus/68a42aba93c064c0827272c60f438b35 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
function my_more_options() { | |
add_settings_field('phone', 'Телефон', 'display_phone', 'general'); | |
register_setting('general', 'company_phone'); | |
} | |
add_action('admin_init', 'my_more_options'); | |
function display_phone() { | |
echo "<input type='text' name='company_phone' autocomplete='off' value='".esc_attr(get_option('company_phone'))."'>"; | |
} | |
//Вывод | |
echo get_option('company_phone'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment