Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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

 
PREVIOUS NEXT
Tagged: #Uncaught #Call #undefined #function
ADD COMMENT
Topic
Name
3+4 =