Answers for "how add administration menu in wordpress"

PHP
-1

how add administration menu in wordpress

<?php
/** Step 2 (from text above). */
add_action( 'admin_menu', 'my_menu' );
 
/** Step 1. */
function my_menu() {
    add_options_page(  //this code Add submenu page to the Settings main menu
        'My Options',
        'My Menu',       //this paramenter display menu option in administration setting 
        'manage_options',
        'my-unique-identifier',
        'my_options'
    );
}
 
/** Step 3. */
function my_options() {
    if ( !current_user_can( 'manage_options' ) ) {
        wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
    }
    echo 'Here is where I output the HTML for my screen.';
    echo '</div><pre>';
}
?>
Posted by: Guest on November-20-2020

Code answers related to "how add administration menu in wordpress"

Browse Popular Code Answers by Language