🎓 WordPress Plugin Development Tutorial
Learn WordPress plugin development step-by-step — each module includes copyable examples with live progress bars powered by Prism.js.
🧩 Module 3: Admin Menu & Settings Page
Now we’ll create an admin menu inside your WordPress Dashboard.
function mfp_add_admin_menu() {
add_menu_page(
'My Plugin Settings',
'My Plugin',
'manage_options',
'my-plugin-settings',
'mfp_admin_page_html',
'dashicons-admin-generic',
20
);
}
add_action('admin_menu', 'mfp_add_admin_menu');
function mfp_admin_page_html() {
if (!current_user_can('manage_options')) return;
echo '<div class="wrap">';
echo '<h1>My Plugin Settings</h1>';
echo '<p>Welcome to your custom settings page!</p>';
echo '</div>';
}
No comments:
Post a Comment