Untitled
unknown
plain_text
2 years ago
848 B
8
Indexable
function b2bking_add_csv_order_endpoint() {
add_rewrite_endpoint( 'csv-order', EP_ROOT | EP_PAGES );
}
add_action( 'init', 'b2bking_add_csv_order_endpoint' );
function b2bking_csv_order_query_vars( $vars ) {
$vars[] = 'csv-order';
return $vars;
}
add_filter( 'query_vars', 'b2bking_csv_order_query_vars', 0 );
function b2bking_add_csv_order_link_my_account( $items ) {
$last_item = $items['customer-logout'];
unset($items['customer-logout']);
$items['csv-order'] = 'CSV Orders';
$items['customer-logout'] = $last_item;
return $items;
}
add_filter( 'woocommerce_account_menu_items', 'b2bking_add_csv_order_link_my_account', 1000000 );
function b2bking_csv_order_content() {
echo do_shortcode( '[b2bking_csvorder]' );
}
add_action( 'woocommerce_account_csv-order_endpoint', 'b2bking_csv_order_content' );Editor is loading...
Leave a Comment