How can i add new endpoints to WooCommerce my account menu and show my custom content with below array? endpoint=custom_endpoint, lable=endpoint lable, icon=any icon just the below code return 404 eror
// Enable endpoint
add_filter( 'woocommerce_get_query_vars', 'myaccount_custom_endpoint_query_var' );
function myaccount_custom_endpoint_query_var( $query_vars ) {
$query_vars['custom-endpoint'] = 'custom-endpoint';
return $query_vars;
}
// Endpoint displayed content
add_action('woocommerce_account_custom-endpoint_endpoint', 'display_custom_endpoint_content' );
function display_custom_endpoint_content(){
echo '<p>' . __("hello") . '</p>';
}