LLMS_Form_Post_Type::maybe_prevent_deletion( null|bool $prevent, WP_Post $post )

Maybe prevent a post from being deleted/trashed.


Description Description

We do not allow the "core" forms to be deleted. This action prevents both deletion and trash actions when run against one of the core form.


Top ↑

Parameters Parameters

$prevent

(null|bool) (Required) Whether or not the action has been prevented.

$post

(WP_Post) (Required) The form post object.


Top ↑

Return Return

(null|false) Returns null when we don't prevent the action and false if we should.


Top ↑

Source Source

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

	public function maybe_prevent_deletion( $prevent, $post ) {

		if ( $post->post_type === $this->post_type && LLMS_Forms::instance()->is_a_core_form( $post ) ) {
			$prevent = false;
		}

		return $prevent;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
6.4.0 Use LLMS_Forms::is_a_core_form() to determine whether a form is a core form and cannot be deleted.
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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