• Resolved fraxinusstudio

    (@fraxinusstudio)


    Following the info on this page: https://docs.wpeverest.com/user-registration/docs/how-to-add-additional-tabs-in-my-account/

    I was able to add the “New” endpoint using the code provided there but if I try to alter it for what I need then I get a 404. This is my code:

    add_filter( 'user_registration_account_menu_items', 'test_custom_menu_items', 10, 1 );
    
    function test_custom_menu_items( $items ) {
    
    $items['test'] = __( 'Test', 'user-registration' );
    
    return $items;
    
    }
    
    add_action( 'init', 'user_registration_add_test_endpoint' );
    
    function user_registration_add_test_endpoint() {
    
    add_rewrite_endpoint( 'test', EP_PAGES );
    
    }
    
    function test_tab_content() {
    
    echo 'Test content';
    
    }
    
    add_action( 'user_registration_account_test_endpoint', 'test_tab_content' );

    Any ideas?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Can’t create custom account tab’ is closed to new replies.