LLMS_Forms::maybe_load_preview( WP_Post|boolean $post )
Load form autosaves when previewing a form
Parameters Parameters
- $post
-
(WP_Post|boolean) (Required) WP_Post object for the llms_form post or
false
if no form found.
Return Return
(WP_Post|boolean)
Source Source
File: includes/forms/class-llms-forms.php
* @param WP_Post|boolean $post WP_Post object for the llms_form post or `false` if no form found. * @return WP_Post|boolean */ public function maybe_load_preview( $post ) { // No form post found. if ( ! is_object( $post ) ) { return $post; } // The `_set_preview()` method is marked as private but has existed since 2.7 and my guess is that we can use this safely. if ( ! function_exists( '_set_preview' ) ) { return $post; } $is_preview = ( is_preview() && current_user_can( $this->get_capability(), $post->ID ) );
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |