LLMS_REST_Access_Plans_Controller::get_item_schema()

Get the Access Plan’s schema, conforming to JSON Schema


Return Return

(array)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/server/class-llms-rest-access-plans-controller.php

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
*/
public function get_item_schema_base() {
 
    $schema = (array) parent::get_item_schema_base();
 
    // Post properties to unset.
    $properties_to_unset = array(
        'comment_status',
        'excerpt',
        'featured_media',
        'password',
        'ping_status',
        'slug',
        'status',
    );
 
    foreach ( $properties_to_unset as $to_unset ) {
        unset( $schema['properties'][ $to_unset ] );
    }
 
    // The content is not required.
    unset( $schema['properties']['content']['required'] );
 
    $access_plan_properties = require LLMS_REST_API_PLUGIN_DIR . 'includes/server/schemas/schema-access-plans.php';
 
    $schema['properties'] = array_merge(
        $schema['properties'],
        $access_plan_properties
    );
 
    return $schema;
 
}
 
/**
 * Retrieves the query params for the objects collection
 *
 * @since 1.0.0-beta.18


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.18 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.