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.
Parameters Parameters
- $prevent
-
(null|bool) (Required) Whether or not the action has been prevented.
- $post
-
(WP_Post) (Required) The form post object.
Return Return
(null|false) Returns null
when we don't prevent the action and false
if we should.
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; }
Expand full source code Collapse full source code View on GitHub
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. |