PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 All 140 releases
← All changes | inc/jwt/rest-api/version1/class-lp-rest-controller.php +35 -35 4.3.8 → 4.4.9 View file →
@@ -1,35 +1,35 @@
1 -<?php
2 -abstract class LP_REST_Jwt_Controller extends WP_REST_Controller {
3 - protected $namespace = 'learnpress/v1';
4 -
5 - protected $rest_base = '';
6 -
7 - private $_fields = null;
8 -
9 - private $_request = null;
10 -
11 - protected function add_additional_fields_schema( $schema ) {
12 - if ( empty( $schema['title'] ) ) {
13 - return $schema;
14 - }
15 -
16 - /**
17 - * Can't use $this->get_object_type otherwise we cause an inf loop.
18 - */
19 - $object_type = $schema['title'];
20 -
21 - $additional_fields = $this->get_additional_fields( $object_type );
22 -
23 - foreach ( $additional_fields as $field_name => $field_options ) {
24 - if ( ! $field_options['schema'] ) {
25 - continue;
26 - }
27 -
28 - $schema['properties'][ $field_name ] = $field_options['schema'];
29 - }
30 -
31 - $schema['properties'] = apply_filters( 'lp_jwt_rest_' . $object_type . '_schema', $schema['properties'] );
32 -
33 - return $schema;
34 - }
35 -}
1 +<?php
2 +abstract class LP_REST_Jwt_Controller extends WP_REST_Controller {
3 + protected $namespace = 'learnpress/v1';
4 +
5 + protected $rest_base = '';
6 +
7 + private $_fields = null;
8 +
9 + private $_request = null;
10 +
11 + protected function add_additional_fields_schema( $schema ) {
12 + if ( empty( $schema['title'] ) ) {
13 + return $schema;
14 + }
15 +
16 + /**
17 + * Can't use $this->get_object_type otherwise we cause an inf loop.
18 + */
19 + $object_type = $schema['title'];
20 +
21 + $additional_fields = $this->get_additional_fields( $object_type );
22 +
23 + foreach ( $additional_fields as $field_name => $field_options ) {
24 + if ( ! $field_options['schema'] ) {
25 + continue;
26 + }
27 +
28 + $schema['properties'][ $field_name ] = $field_options['schema'];
29 + }
30 +
31 + $schema['properties'] = apply_filters( 'lp_jwt_rest_' . $object_type . '_schema', $schema['properties'] );
32 +
33 + return $schema;
34 + }
35 +}