LLMS_Admin_Meta_Boxes::validate_post( $post_id, $post )
Validates post and metabox data before saving.
Description Description
Parameters Parameters
- $post,
-
(Required) $post_id
Return Return
(bool)
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 ( empty( $_POST['lifterlms_meta_nonce'] ) || ! wp_verify_nonce( $_POST['lifterlms_meta_nonce'], 'lifterlms_save_data' ) ) { return false; } elseif ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id ) { return false; } return true; }
Expand full source code Collapse full source code View on GitHub