baxtian / wp_json
Base class for merak REST API endpoints.
0.1.2
2026-06-06 00:54 UTC
Requires
- php: >=7.4
README
Class to be inherited to create a WP REST API endpoint.
Extend WP_Json and implement the api() method to register routes via register_rest_route().
Use self::success($data) and self::error($message) for standard responses.
Use sanitize_boolean(), sanitize_float() and sanitize_array() as sanitize_callback in route args.
Mantainers
Juan Sebastián Echeverry baxtian.echeverry@gmail.com
Changelog
0.1.2
- Add method sanitize_structured_array
0.1.1
- Fix: Force cast to float in sanitize float to guarantee the return type
0.1.0
- First stable release