Skip to content

Conversation

@badasswp
Copy link
Owner

@badasswp badasswp commented Sep 20, 2025

This PR resolves this issue.

Description / Background Context

At the moment, the REST namespace is pretty much hard-coded and leaves no room for users to use a customized namespace of their choice. This PR introduces a filter called cbtj_rest_namespace to allow for this customization. It also contains significant refactor of the plugin to use classes.

Testing Instructions

  1. Pull PR to local.
  2. Build correctly by running rm -rf node_modules && yarn start.
  3. Observe that block import & export functionality work correctly without any regressions.
  4. Proceed to add custom filter like so:
add_filter( 'cbtj_rest_namespace', function( $namespace ) {
    return 'my-custom-namespace/v1';
} );
  1. Observe that endpoint now works with my-custom-namespace/v1 in the route path.

@badasswp badasswp force-pushed the refactor/implement-rest-namespace-filter-and-code-housekeeping branch from 8a46e09 to 76e2393 Compare September 20, 2025 20:33
@badasswp badasswp self-assigned this Sep 20, 2025
@badasswp badasswp added the enhancement New feature or request label Sep 20, 2025
@badasswp badasswp added the chore Task to be done label Sep 20, 2025
@badasswp badasswp linked an issue Sep 20, 2025 that may be closed by this pull request
@badasswp badasswp added the test Unit/Integration tests label Sep 20, 2025
@badasswp badasswp merged commit 34c12f7 into release-1.1.0 Sep 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Task to be done enhancement New feature or request test Unit/Integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Customise REST namespace

2 participants