Hey guys
I have a simple plugin and 3 inputs. Now I want to display inputs on everypage on submit
. Does anyone can help me?
[php]
// create custom plugin settings menu
add_action(‘admin_menu’, ‘my_cool_plugin_create_menu’);
function my_cool_plugin_create_menu() {
//create new top-level menu
add_menu_page('My Cool Plugin Settings', 'Scroll to top', 'administrator', __FILE__, 'my_cool_plugin_settings_page' , plugins_url('/icon.png', __FILE__) );
//call register settings function
add_action( 'admin_init', 'register_my_cool_plugin_settings' );
}
function register_my_cool_plugin_settings() {
//register our settings
register_setting( ‘my-cool-plugin-settings-group’, ‘new_option_name’ );
register_setting( ‘my-cool-plugin-settings-group’, ‘some_other_option’ );
register_setting( ‘my-cool-plugin-settings-group’, ‘option_etc’ );
}
function my_cool_plugin_settings_page() {
?>
Your Plugin Name
<?php settings_fields( 'my-cool-plugin-settings-group' ); ?> <?php do_settings_sections( 'my-cool-plugin-settings-group' ); ?>New Option Name |
---|