You've already forked wc-licensed-product
Fix licenses endpoint 404 error in customer account
- Register licenses query var with WooCommerce via woocommerce_get_query_vars - Register endpoint in Installer before flushing rewrite rules - Existing installations need to re-save permalinks The endpoint was not being recognized because WooCommerce's My Account requires both add_rewrite_endpoint() and query var registration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
15
CLAUDE.md
15
CLAUDE.md
@@ -553,3 +553,18 @@ Full API documentation available in `openapi.json` (OpenAPI 3.1 specification).
|
||||
- Domain validation with normalization (strips protocol, www prefix)
|
||||
- Inline edit UI with save/cancel for license domains
|
||||
- Links to full licenses management page for advanced actions
|
||||
|
||||
**Bug fix (post v0.0.10):**
|
||||
|
||||
- Fixed: Licenses menu item in customer account page resulted in 404 error
|
||||
|
||||
**Root cause:**
|
||||
|
||||
- WooCommerce My Account endpoints require both `add_rewrite_endpoint()` AND registration with `woocommerce_get_query_vars` filter
|
||||
- The endpoint also needs to be registered before rewrite rules are flushed during activation
|
||||
|
||||
**Fix:**
|
||||
|
||||
- Added `addLicensesQueryVar()` method to register the endpoint query var with WooCommerce
|
||||
- Updated Installer to register endpoint before flushing rewrite rules on activation
|
||||
- Existing installations may need to visit Settings > Permalinks and click Save to regenerate rewrite rules
|
||||
|
||||
Reference in New Issue
Block a user