Thanks to @mmm and his comment defining $endpointsub before $endpoint it worked. Not sure why that is but that solved it.
So change the order of endpoints:
$endpointsub = 'my-new-endpoint/new-subendpoint';
$endpoint="my-new-endpoint";
add_rewrite_endpoint( self::$endpointsub, EP_ROOT | EP_PAGES );
add_rewrite_endpoint( self::$endpoint, EP_ROOT | EP_PAGES );
add_query_vars( $vars ) {
$vars[] = self::$endpointsub;
$vars[] = self::$endpoint;
return $vars;
}
Related Posts:
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- Woocommerce My Account Endpoint – how to get ID parameter from URL?
- Woocommerce Customs Endpoint
- Custom account page that accepts a query parameter
- If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?
- Woocommerce – Add a product to cart programmatically via JS or PHP [closed]
- ( Woocommerce) How to get the user belonging to an order? [closed]
- Product categories don’t appear as option to build menu
- Woocommerce show cross sells on singe product page [closed]
- WooCommerce: Webhook disabled on its own
- Insert variations via woocommerce api [closed]
- Display order items names in WooCommerce admin orders list [closed]
- How to delete woo commerce order pragmatically? [closed]
- How to turn off WooCommerce user registration and manually create accounts?
- Remember page before login page, redirect to that page after login
- Hook and send Woocommerce data after click Place Order button
- WooCommerce Change Product Global Attribute Value via CRUD for Simple Product [closed]
- Search results don’t show products
- When Free shipping is available hide other shipping methods except Local pickup in WooCommerce [closed]
- Change WooCommerce Image Size in One Product CAtegory
- Is there a way to get customers logged out without calling wp-login.php?
- WooCommerce lost password reset flow not working with SendGrid (redirect loop)
- Change add to cart text if a product is in cart on WooCommerce
- Get user payment details when payment successfully done in woocommerce [closed]
- How to assign specific attribute to variation for woocommerce product?
- How to filter Post using Meta Data REST API
- How to change page via login as user and admin
- WooCommerce checkout: How can I change $field_container of a checkout field?
- How to remove the sub-category from Woocommerce product URL
- Find woocommerce product ID by custom field value?
- Woocommerce Shop Price Position
- How to disable users from editing billing address in WooCommerce checkout?
- Move WooCommerce product tabs out of the tabs [closed]
- Is it possible to recalculate cart prices? [closed]
- Woocommerce: Get Cart ID
- Woocommerce – remove sale price field from dashboard [closed]
- how to use different page design for different category
- Getting WordPress database error Deadlock
- WooCommerce WebHook Retry
- Can I set a custom “alt” attribute with woocommerce_get_product_thumbnail()?
- Remove all Span Tags and class From Woocommerce Price [closed]
- Importing Woocommerce products with variations
- Woocommerce login not working on the first try
- Show add to cart button on shop woocommerce
- How do I hide the purchase note in the WooCommerce ‘order completed’ email?
- Woocommerce – Override the default templates location under the theme directory
- How to hide out of stock products in Related Products via custom query in WooCommerce
- Changing Woocommerce language without changing the language in Dashboard admin WordPress
- WooCommerce Country Drop Down colours CSS [closed]
- Fatal error: Call to undefined method WooCommerce::nonce_field()
- Where do I find where woocommerce stores product data in cpanel file manager?
- Woocommerce wp-admin search products through custom meta value too
- show shop instead of 404 page for missing products
- if statement for search results
- Woocommerce exclude specific categories products from related products
- Woocommerce: Prevent sending of email when order is “Completed”
- Apply a discount percentage to regular price WooCommerce by function
- Avada & WooCommerce Customization – Replacing product_title in woo-config.php [closed]
- How to unset fields in woocommerce product quick edit?
- rating, share and review issue for single WooCommerce page
- Delete All Product Images in phpmyadmin
- How to add a custom text for order confirmation email template woocommerce
- WooCommerce template page for category
- Custom PLU field in woocommerce email
- I want to get the value of a select attribute in the checkout page, and then use it to show or not the delivery data
- woocomerce is serving OR Relation instead of AND on taxonomy product_tag
- Woocommerce Subscriptions – Set Billing Interval/Period
- WooCommerce with ACF: custom fields per product variation
- Woocommerce checkout page reload on up dating shipping method
- change wp_login url and redirect users at the same time
- How to clear woocommerce checkout form after pageload
- Is there a plugin available for recurring orders in Woocommerce? [closed]
- Woocommerce PHP site that shows table with orders from specific category
- How to get the webshop page in 2:nd language, with Polylang and Hyyan
- Subcategories not working when using shared base with custom taxonomy
- Change how the Subtotal Price in cart being calculated [closed]
- Display Advanced Custom Fields value in Woocommerce admin order details
- Some images aren’t shown on wordpress after installation on host
- How to display text between product thumbnail and CTA button on WooCommerce “Shop” page
- Multiple archive product exist
- call_user_func_array() error in class-wp-hook.php
- Error after woocommerce update from 2.6 to 3.5 [closed]
- Send billing info from woocommerce checkout page to paypal checkout form
- Check if a category has a parent category in WooCommerce REST API
- Remove a higher quantity from stock according to a variation
- Auto generate user email while registration
- WooCommerce Cart Total Table chronology order change [closed]
- Woocommerce Update Order Notes Date
- Shipping Method does not inherit settings from the class
- My woocommerce checkout page and woocommerce setting page are not responding [closed]
- Woocommerce Shortcode custom orderby not working
- Show only one variaton in catalog on meta key
- WordPress & WooCommerce: Localhost, Staging and production environments and how to sync them without losing data
- PayPal Express on product page in WooCommerce – doesn’t seem to work on product page?
- Woocommerce – Want to block a user agent from accessing specific product pages
- Reset all stock status in woocommerce
- How to – proper WordPress 301 redirects?
- Switch position of short description and variations [closed]
- Add rewrite rule to make Woocommerce product category page seo friendly
- How to add woocommerce products header title in woocommerce_breadcrumb hook to function.php