Answers for "custom api endpoints jwt token"

0

custom api endpoints jwt token

add_action('rest_api_init', function ($data) {
        register_rest_route('mladi-info/v1', '/user/favorites', 
            array(
                'methods' => 'GET',
                'callback' => 'mi_get_favorite_posts',
                'permission_callback' => function ($request) {
                        if (current_user_can('edit_others_posts'))
                        return true;
                 }
             )
        );
    });
Posted by: Guest on November-07-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language