I'm customizing my own options page for a plugin and I have a very basic question about arrays that I'm attempting to input in my add_options_page under the $function. My code looks like this:
function myplugin_register_settings() {
add_option('myplugin_option_name', 'Option Value');
register_setting('myplugin_options_group', 'myplugin_option_name', 'myplugin_callback');
}
add_action('admin_init', 'myplugin_register_settings')
function create_plugin_settings_page() {
add_options_page('Page Title', 'Plugin Menu', 'manage_options', 'myplugin', array( $this, 'plugin_settings_page_content'));
}
add_action('admin_menu', array($this, 'create_plugin_settings_page'));
function plugin_settings_page_content() {
echo 'Hello World';
}
Unfortunately when I remove the arrays my code works perfectly. I'd like to keep them included because I'm looking to input a text field that saves to the database. Anyone help me?