Support » Plugin: JWT Authentication for WP REST API » Add ability to filter namespace

  • Dale Mugford

    (@dalemugford)


    Great work!!

    For better compatibility and to allow apps to control versioning, I propose adding a filter for the namespace, such as:

    	public function add_api_routes()
        {
    		$namespace = $this->namespace;
    		$namespace = apply_filters( 'jwt_namespace_filter', $namespace );

    I’ve hacked this in and used it along with rest_url_prefix to clean up api urls, e.g. mysite.com/api/v1/token.

    Would be nice to have the plugin itself support the change so I don’t have to do manual updates to the plugin on plugin updates.

  • The topic ‘Add ability to filter namespace’ is closed to new replies.