Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Uncaught Error: Call to undefined function add_submenu_page()

//Try this code 
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 Page inside settings content
    );
}
add_action( 'admin_menu', 'books_register_ref_page', 0 ); //resgister the function

//My mistake was i was using 
add_action( 'init', 'books_register_ref_page', 0 ); //  was using init instead of admin_menu

Comment

PREVIOUS NEXT
Code Example
Php :: how to removde product into shop loop via product id 
Php :: laravel get data from model to controller 
Php :: add data in textarea with php variable 
Php :: static function php 
Php :: php move in array 
Php :: php timezone paris 
Php :: change sender name laravel 
Php :: debugger in laravel 
Php :: echo placeholder image if post thumbnail not found 
Php :: wordpress change email new user template 
Php :: symfony get locale from request in controller 
Php :: get month days in php 
Php :: php location header not working 
Php :: php division 
Php :: php obfuscate email 
Php :: laravel get list of files in directory 
Php :: link title to blog post wordpress in the loop 
Php :: check url parameter if not redirect wordpress 
Php :: hot to use functions in heredoc 
Php :: guzzlehttp http_errors get 
Php :: php config file 
Php :: connexion à la base de donnée microsoftsqlserver avec php 
Php :: read input from user 
Php :: laravel make job command 
Php :: phpmail headers 
Php :: cakephp sql query 
Php :: download file on client from server url php 
Php :: get id from object 
Php :: php loop in js 
Php :: publish spatie/permission 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =