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

PREVIOUS NEXT
Code Example
Php :: php remove space before and after string 
Php :: age php datetime 
Php :: count child products for each parent Product laravel 
Php :: customer io send_at api 
Php :: to paste file in opt/lampp 
Php :: randomstring php 
Php :: acf repeater example count 
Php :: php json_decode 
Php :: laravel blade auth check 
Php :: php get ip by domain 
Php :: how handle the number with k in laravel balde 
Php :: mySQL phpMyAdmin with Google Chrome: stuck on loading 
Php :: remove get parameters from url php 
Php :: select session php 
Php :: disable SSL check in PHP cURL 
Php :: I cannot login to my CPanel hosted Laravel Application, my SSL has expired 
Php :: php pdo set charset 
Php :: .htaccess for laravel in hostinger 
Php :: facebook neuer name 
Php :: codeigniter set timezone 
Php :: php salto de linea 
Php :: carbon 2 days ago 
Php :: PHP str_shuffle — Randomly shuffles a string 
Php :: get all errors view laravel 
Php :: translate youtube link into iframe in laravel 
Php :: php favicon 
Php :: Show all DB Tables in php 
Php :: php select page change 
Php :: PHP | get client ip simple 
Php :: get original name without mutant model laravel 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =