'Wordpress admin menu not showing
I'm building my first Worpess plugin. But 'hammu dating' is not showing up in the 'settings' panel in the wp-admin. The plugin is activated in the 'plugin' panel. I followed the instructions from here.
add_action( 'admin_menu', 'hammenu' );
function hammenu() {
add_options_page( 'opties', 'Opties', 'manage-options', 'hd_menu_1', 'hammu_options' );
}
function hammu_options() {
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'No rights' ) );
}
echo '<div class="wrap">';
echo '<p>Nothing interesting here, yet</p>';
echo '</div>';
}
Note: this is just a part of the plugin code
Solution 1:[1]
The add_options_page(); function carries wrong capability slug: manage-options
use manage_options instead.
Hope it helps!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | iEmanuele |
