Skip to content

Releases: Attributes-PHP/wp-fastendpoints

v4.0.0

16 Nov 20:52

Choose a tag to compare

v3.1.1

13 Nov 20:31
07c6664

Choose a tag to compare

  • Addressed security issue by upgrading Symfony package

v3.1.0

10 Oct 12:37

Choose a tag to compare

  • Adds support for error handling via onException function
                                                    // Type what you need
$router->onException(CustomException::class, function (UserNotFoundException $e) {
    return new WpError(404, $e->getMessage());
);

$router->get('/user', function () {
    throw new UserNotFoundException('My custom exception');
});

v3.0.1

08 Oct 17:00

Choose a tag to compare

  • Returning false in a permission callback blocks the user action

v3.0.0

23 Aug 19:43
9786c2b

Choose a tag to compare

  • Uses Attributes-PHP/Validation to validate your request payload and response

v2.1.1

18 Mar 08:45
d97f591

Choose a tag to compare

  • Upgrade package dependencies

v2.1.0

15 Nov 14:58
eb5d9be

Choose a tag to compare

  • Adds support for router dependencies
  • Adds dependencies support for native WP REST endpoints by passing dependencies via argument
$router = new Router('api', 'v1');
$router->depends('buddypress');  // Global dependency across all sub-routers/endpoints
// Support for native WP REST endpoints
$args = [
    'methods' => 'GET',
    'depends' => ['buddypress'],
    ...
];
register_rest_route('api/v1', 'custom-endpoint', $args);

v2.0.0

17 Jul 08:09

Choose a tag to compare

  • Changed variable special vars from {ID} to <ID> to keep consistency
  • Specifying endpoint plugin dependencies. This feature by its own doesn't do anything but if the WP-FastEndpoints-Depends plugin is active it does speed up your endpoints 😊
$router->get('(?P<postId>[\d]+)', function ($postId) {
    return get_post($postId);
})
->hasCap('edit_post', '<ID>')
// With WP-FastEndpoints-Depends it only loads the buddypress plugin
->depends('buddypress');

v1.2.2

18 May 11:10
1c958d3

Choose a tag to compare

  • Added three new filter hooks to allow the customisation of the JSON schema validator:
    • fastendpoints_validator - Triggered by all validators e.g. schema and response
    • fastendpoints_schema_validator - Triggered only by the request schema validator
    • fastendpoints_response_validator - Triggered only by the response schema validator

v1.2.1

16 May 18:36

Choose a tag to compare