LLMS_Admin_Meta_Boxes::validate_post( int $post_id, WP_Post $post )

Validates post and metabox data before saving.


Parameters Parameters

$post_id

(int) (Required) WP Post ID.

$post

(WP_Post) (Required) Post object.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/admin/post-types/class.llms.meta.boxes.php

	public function validate_post( $post_id, $post ) {

		if ( ! current_user_can( 'edit_post', $post_id ) ) {
			return false;
		} elseif ( empty( $post_id ) || empty( $post ) ) {
			return false;
		} elseif ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post ) ) || is_int( wp_is_post_autosave( $post ) ) ) {
			return false;
		} elseif ( ! llms_verify_nonce( 'lifterlms_meta_nonce', 'lifterlms_save_data' ) ) {
			return false;
		} elseif ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id ) {
			return false;
		}

		return true;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.35.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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