• This function adds a tab named “Special Page” into “My Account” tab list:

    add_filter( 'woocommerce_account_menu_items' , 'jc_menu_panel_nav' );
    
    function jc_menu_panel_nav() {
    	$items = array(
    		'dashboard'       => __( 'Dashboard', 'woocommerce' ),
    		'orders'          => __( 'Orders', 'woocommerce' ),
    		'downloads'       => __( 'Downloads', 'woocommerce' ),
    		'edit-address'    => __( 'Addresses', 'woocommerce' ),
    		'payment-methods' => __( 'Payment Methods', 'woocommerce' ),
    		'edit-account'    => __( 'Account Details', 'woocommerce' ),
    		'special-page' => __( 'Special Page', 'woocommerce' ), // My custom tab here
    		'customer-logout' => __( 'Logout', 'woocommerce' ),
    	);
    
    	return $items;
    }

    That results in this: [ View Image ]

    And the link points to my-account/special-page/, but naturally gives a 404 error.

    How I can assign this URL to a file named special-page.php?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    It doesn’t work that way. You need code to handle the endpoint as shown in the docs.

    Go to Settings >Permalinks and save to prevent 404

Viewing 1 replies (of 1 total)
  • The topic ‘how to assign a URL to a file in WooCommerce?’ is closed to new replies.