{"action":"created","issue":{"url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/298","labels_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/298/comments","events_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/298/events","html_url":"https://github.com/DevinVinson/WordPress-Plugin-Boilerplate/issues/298","id":83441905,"number":298,"title":"How to show the admin page (admin/partials/pluginname-admin-display.php)?","user":{"login":"lazharichir","id":12215372,"avatar_url":"https://avatars.githubusercontent.com/u/12215372?v=3","gravatar_id":"","url":"https://api.github.com/users/lazharichir","html_url":"https://github.com/lazharichir","followers_url":"https://api.github.com/users/lazharichir/followers","following_url":"https://api.github.com/users/lazharichir/following{/other_user}","gists_url":"https://api.github.com/users/lazharichir/gists{/gist_id}","starred_url":"https://api.github.com/users/lazharichir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazharichir/subscriptions","organizations_url":"https://api.github.com/users/lazharichir/orgs","repos_url":"https://api.github.com/users/lazharichir/repos","events_url":"https://api.github.com/users/lazharichir/events{/privacy}","received_events_url":"https://api.github.com/users/lazharichir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-01T11:12:42Z","updated_at":"2015-07-08T15:01:17Z","closed_at":null,"body":"Hello all,\r\n\r\nA bit confused, I created my plugin pretty much and now need to create my settings admin page. I added a hook in pluginname-class.php as follows:\r\n\r\n\t// Settings\r\n\t$this->loader->add_action( 'admin_init', $plugin_admin, 'display_admin_page' );\r\n\r\nAnd in my class-pluginname-admin.php, I have my function:\r\n\r\n\tpublic function display_admin_page() {\r\n\r\n\t\tadd_settings_section(\r\n\t\t\t'eg_setting_section',\r\n\t\t\t'Example settings section in reading',\r\n\t\t\t'eg_setting_section_callback_function',\r\n\t\t\t'reading'\r\n\t\t);\r\n\r\n\t\tadd_settings_field(\r\n\t\t\t'eg_setting_name',\r\n\t\t\t'Example setting Name',\r\n\t\t\t'eg_setting_callback_function',\r\n\t\t\t'reading',\r\n\t\t\t'eg_setting_section'\r\n\t\t);\r\n\t\t\r\n\t\tregister_setting( 'reading', 'eg_setting_name' );\r\n\r\n\t\t//require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/pluginname-admin-display.php'; i tried uncommenting this one line but still no luck\r\n\r\n\t}\r\n\r\n\tpublic function eg_setting_section_callback_function() {\r\n\t\techo '<p>Intro text for our settings section</p>';\r\n\t}\r\n\r\n\tpublic function eg_setting_callback_function() {\r\n\t\techo '<input name=\"eg_setting_name\" id=\"eg_setting_name\" type=\"checkbox\" value=\"1\" class=\"code\" ' . checked( 1, get_option( 'eg_setting_name' ), false ) . ' /> Explanation text';\r\n\t}\r\n\r\nHowever, I get the error **Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'display_admin_page' not found or invalid function name in /Users/dev/wp-includes/plugin.php on line 496** and the admin page is not displayed (the page is in admin/partials/pluginname-admin.display.php)\r\n\r\nHow can I get to display my admin settings page?!"},"comment":{"url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/comments/119614618","html_url":"https://github.com/DevinVinson/WordPress-Plugin-Boilerplate/issues/298#issuecomment-119614618","issue_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/298","id":119614618,"user":{"login":"lazharichir","id":12215372,"avatar_url":"https://avatars.githubusercontent.com/u/12215372?v=3","gravatar_id":"","url":"https://api.github.com/users/lazharichir","html_url":"https://github.com/lazharichir","followers_url":"https://api.github.com/users/lazharichir/followers","following_url":"https://api.github.com/users/lazharichir/following{/other_user}","gists_url":"https://api.github.com/users/lazharichir/gists{/gist_id}","starred_url":"https://api.github.com/users/lazharichir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazharichir/subscriptions","organizations_url":"https://api.github.com/users/lazharichir/orgs","repos_url":"https://api.github.com/users/lazharichir/repos","events_url":"https://api.github.com/users/lazharichir/events{/privacy}","received_events_url":"https://api.github.com/users/lazharichir/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T15:01:17Z","updated_at":"2015-07-08T15:01:17Z","body":"I tried the now-hiring example, and it works up until I save the options, I either get options page not found if I use action=\"options.php\" or it just reloads itself if I leave the action=\"\" blank.\r\n\r\nI used the exact same lines and hooks to try it first, before changing to suit my plugin."}}