LLMS_Form_Post_Type::enable_post_type_visibility( WP_REST_Response $response, WP_Post_Type $post_type )

Forces the non-visible form post type to be visible when REST requests for the post type info are made via the admin panel


Description Description

This enabled the "Preview in new tab" functionality of the block editor to be used to preview LifterLMS form posts.


Top ↑

Parameters Parameters

$response

(WP_REST_Response) (Required) Response object.

$post_type

(WP_Post_Type) (Required) Post Type object.


Top ↑

Return Return

(WP_REST_Response)


Top ↑

Source Source

File: includes/forms/class-llms-form-post-type.php

	public function enable_post_type_visibility( $response, $post_type ) {
		if ( is_admin() && $this->post_type === $post_type->name ) {
			$response->data['viewable'] = true;
		}
		return $response;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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