Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
848 B
1
Indexable
Never
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' );
Leave a Comment