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_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.