admin管理员组文章数量:1392003
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?
本文标签: pluginsArrays not working in my addoptionspage
版权声明:本文标题:plugins - Arrays not working in my add_options_page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744747650a2622982.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论