Add_Submenu_Page for Custom Post Type – loading submenu, but not firing callable function

Question

I am using add_submenu_page for a custom post type – it’s hooked properly. It’s adding the submenu correctly – Stripe Settings shows up in the custom post type menu products, but the callable function ‘stripe_render_options_page’, which is supposed to fire the function, does not fire at all. What am I missing?

    function stripe_submenu_settings_setup() {

    add_submenu_page(
        'edit.php?post_type=products',
        __( 'Stripe Settings', 'customproducts' ),
        __( 'Stripe Settings', 'customproducts' ),
        'manage_options',
        'stripe-settings-keys',
        'stripe_render_options_page'
    );
}

//this function is not firing...why?
function stripe_render_options_page() {
    echo('Hello...computer...do you read me?..');
    //computer looks away, annoyed that it gets paid nothing for its work.
}

Here is the reference for the function: https://developer.wordpress.org/reference/functions/add_submenu_page/

0
Chris Norman 2 months 0 Answers 19 views 0

Leave an answer