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

	public function get_item_schema() {

		$schema = (array) parent::get_item_schema();

		// 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
		);

		/**
		 * Filter item schema for the access-plan controller
		 *
		 * @since 1.0.0-beta.18
		 *
		 * @param array $schema Item schema data.
		 */
		return apply_filters( 'llms_rest_access_plan_item_schema', $schema );

	}


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.