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.
Parameters Parameters
- $response
-
(WP_REST_Response) (Required) Response object.
- $post_type
-
(WP_Post_Type) (Required) Post Type object.
Return Return
(WP_REST_Response)
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; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |