Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress add submenu

add_menu_page('My Custom Page', 'My Custom Page', 'manage_options', 'my-top-level-slug');
add_submenu_page( 'my-top-level-slug', 'My Custom Page', 'My Custom Page',
    'manage_options', 'my-top-level-slug');
add_submenu_page( 'my-top-level-slug', 'My Custom Submenu Page', 'My Custom Submenu Page',
    'manage_options', 'my-secondary-slug');
Comment

wordpress add_submenu_page


/**
 * °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Adding settting page to the custom post type
 * menu id : menu-posts-portfolio (left sidebar)
 * 
 */

function books_register_ref_page() {
    add_submenu_page(
        'edit.php?post_type=portfolio',
        __( 'Portfolio Settings', 'portfolio' ), //page titlte
        __( 'Settings', 'portfolio' ), // submenu iteam name
        'manage_options',
        'portofile-setttings', //slug
        'books_ref_page_callback' //render age content
    );
}
add_action( 'init', 'books_register_ref_page', 0 ); //resgister the function
 

/**
 * Display callback for the submenu page.
 */
function books_ref_page_callback() { 
    ?>
    <div class="wrap">
        <p><?php _e( 'Helpful stuff here', 'portfolio' ); ?></p>
    </div>
    <?php
}
Comment

wordpress add submenu

add_menu_page('My Custom Page', 'My Custom Page', 'manage_options', 'my-top-level-slug');
add_submenu_page( 'my-top-level-slug', 'My Custom Page', 'My Custom Page',
    'manage_options', 'my-top-level-slug');
add_submenu_page( 'my-top-level-slug', 'My Custom Submenu Page', 'My Custom Submenu Page',
    'manage_options', 'my-secondary-slug');
Comment

wordpress add_submenu_page


/**
 * °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Adding settting page to the custom post type
 * menu id : menu-posts-portfolio (left sidebar)
 * 
 */

function books_register_ref_page() {
    add_submenu_page(
        'edit.php?post_type=portfolio',
        __( 'Portfolio Settings', 'portfolio' ), //page titlte
        __( 'Settings', 'portfolio' ), // submenu iteam name
        'manage_options',
        'portofile-setttings', //slug
        'books_ref_page_callback' //render age content
    );
}
add_action( 'init', 'books_register_ref_page', 0 ); //resgister the function
 

/**
 * Display callback for the submenu page.
 */
function books_ref_page_callback() { 
    ?>
    <div class="wrap">
        <p><?php _e( 'Helpful stuff here', 'portfolio' ); ?></p>
    </div>
    <?php
}
Comment

PREVIOUS NEXT
Code Example
Php :: disable laravel passport 
Php :: construtor php 
Php :: carbon subtract two dates 
Php :: how get the Photo size upload in laravel 
Php :: laravel unsigned integer 
Php :: php year from date 
Php :: redirect woocommerce thank you 
Php :: yii2 set cookie 
Php :: php date add days 
Php :: PHP not working centos 8 
Php :: laravel collection prepend 
Php :: remove all sessions in laravel 
Php :: wordpress exclude current post from loop 
Php :: delete directory from laravel storage 
Php :: store multiple session in laravel 
Php :: php sort multidimensional array by value 
Php :: current user wordpress 
Php :: php session destroy 
Php :: laravel collection sum array column 
Php :: check number is positive or negative in php 
Php :: xamp to test on mobile 
Php :: laravel migration folder 
Php :: remove item in an array php 
Php :: collapse open by default 
Php :: What does "as" keyword mean in Laravel route ? 
Php :: how to use stored procedure in laravel 
Php :: pdo bind param 
Php :: php switch case default 
Php :: add custom style to wordpress editor 
Php :: Allowed memory size of 1610612736 bytes exhausted 4096 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =