REST_Author.php
5 years ago
REST_Course.php
4 years ago
REST_Course_Announcement.php
5 years ago
REST_Lesson.php
5 years ago
REST_Quiz.php
5 years ago
REST_Rating.php
5 years ago
REST_Response.php
5 years ago
REST_Topic.php
5 years ago
REST_Response.php
22 lines
| 1 | <?php |
| 2 | /* |
| 3 | @Reliable for give rest response |
| 4 | @author : themeum |
| 5 | */ |
| 6 | |
| 7 | namespace TUTOR; |
| 8 | use WP_REST_Response; |
| 9 | |
| 10 | if( ! defined('ABSPATH')) |
| 11 | exit; |
| 12 | |
| 13 | trait REST_Response { |
| 14 | /* |
| 15 | @send WP_REST_Response with |
| 16 | code, message along with data |
| 17 | */ |
| 18 | public static function send(array $response) { |
| 19 | return new WP_REST_Response($response); |
| 20 | } |
| 21 | } |
| 22 |