Here is some of my code:
class proposal {
function __construct() {
add_menu_page('Topic Proposal', 'Topic Proposal', 'read', 'topic_proposal', array(&$this, 'writer_page'), 'dashicons-welcome-add-page');
}
public function load_menu() {
echo 'EHY';
}
public function writer_page() {
?>
<h1>Topic Proposal</h1>
<?php
}
public function editor_page() {
?>
<h1>Topic Proposal</h1>
<?php
}
}
add_action( 'admin_init', function(){return new proposal();});
The "Topic Proposal" shows of on the menu but when I click on it I get this:
You do not have sufficient permissions to access this page.
What am I doing wrong?
add_menu_page
in codex?