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.


Top ↑

Return Return

(WP_Post|boolean)


Top ↑

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 ) );



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.