Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress add submenu under custom post type

//// portfolio is my custom post type

function books_register_ref_page() {
    add_submenu_page(
        'edit.php?post_type=portfolio',
        __( 'Books Shortcode Reference', 'portfolio' ),
        __( 'Shortcode Reference', 'portfolio' ),
        'manage_options',
        'portfolio-shortcode-ref',
        'books_ref_page_callback'
    );
}
add_action( 'init', 'books_register_ref_page', 0 );
 

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

sub menu for post type in wordpress

register_post_type( 'movies',
    array(
            'labels' => array(
                    'name' => __( 'Movies' ),
                    'singular_name' => __( 'Movie' )
            ),
    'public' => true,
    'has_archive' => true,
    'show_in_menu' => 'edit.php?post_type=entertainment'
    )
);

add_action('admin_menu', 'my_admin_menu'); 
function my_admin_menu() { 
    add_submenu_page('edit.php?post_type=entertainment', 'Genre', 'Genre', 'manage_options', 'edit-tags.php?taxonomy=genre&post_type=entertainment'); 
}
Comment

wordpress add submenu under custom post type

/**
 * °°°°°°°°°°°°°°°°°°°°°°°° Adding settting page to the custom post type°°°°°°°°°°°°°°°°°°°°°°°°
 * postType name : portfolio
 */

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">
        <h1><?php _e( 'Portfolio Settings', 'textdomain' ); ?></h1>
        <div><?php include_once('pages/settings.php')?></div>
    </div>
    <?php
}
Comment

wordpress add submenu under custom post type

/**
 * °°°°°°°°°°°°°°°°°°°°°°°° Adding settting page to the custom post type°°°°°°°°°°°°°°°°°°°°°°°°
 * postType name : portfolio
 */

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">
        <h1><?php _e( 'Portfolio Settings', 'textdomain' ); ?></h1>
        <div><?php include_once('pages/settings.php')?></div>
    </div>
    <?php
}
Comment

wordpress add submenu under custom post type

/**
 * °°°°°°°°°°°°°°°°°°°°°°°° Adding settting page to the custom post type°°°°°°°°°°°°°°°°°°°°°°°°
 * postType name : portfolio
 */

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">
        <h1><?php _e( 'Portfolio Settings', 'textdomain' ); ?></h1>
        <div><?php include_once('pages/settings.php')?></div>
    </div>
    <?php
}
Comment

wordpress add submenu under custom post type

/**
 * °°°°°°°°°°°°°°°°°°°°°°°° Adding settting page to the custom post type°°°°°°°°°°°°°°°°°°°°°°°°
 * postType name : portfolio
 */

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">
        <h1><?php _e( 'Portfolio Settings', 'textdomain' ); ?></h1>
        <div><?php include_once('pages/settings.php')?></div>
    </div>
    <?php
}
Comment

PREVIOUS NEXT
Code Example
Php :: php command line check syntax errors 
Php :: php ifelse 
Php :: php multiplei str 
Php :: custom blade directive 
Php :: phpmailer doesnt work on infinityfree 
Php :: Laravel htaccess for aws ec2 
Php :: octobercms mail view 
Php :: canany else 
Php :: laravel blade multiple can 
Php :: mysql between all months days even null 
Php :: decrypt md5 php 
Php :: blade check user role laravel 
Php :: numberformater php format to k and m 
Php :: laravel add many to many 
Php :: how to define a function in scheme 
Php :: how get some parameter from request in laravel 
Php :: php post not working 
Php :: laravel route model binding 
Php :: how to integrate google reCAPTCHA in codeigniter? 
Php :: laravel collection take 
Php :: remove field from object php 
Php :: php xpath attribute exact 
Php :: bool value of blank string inp php 
Php :: php += 
Php :: install multiple php versions windows 
Php :: check dir php 
Php :: wordpress get all published post 
Php :: date comparison function in php 
Php :: login as user in laravel from admin panel 
Php :: require password confirm laravel 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =