LLMS_Blocks_Post_Types::enable_rest( array $data )

Enable the rest API for custom post types & taxonomies


Parameters Parameters

$data

(array) (Required) post type / taxonomy data.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: libraries/lifterlms-blocks/includes/class-llms-blocks-post-types.php

	public function enable_rest( $data ) {

		if ( current_user_can( 'lifterlms_instructor' ) ) {
			$data['show_in_rest'] = true;
		}

		return $data;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.2 Only show_in_rest for authenticated users with the lifterls_instructor capability.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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