* * @param int $postId The Post ID. * @return boolean Whether or not sholud limit the modified date. */ public function limitModifiedDate( $postId ) { if ( ! class_exists( 'TCB_Editor_Ajax' ) ) { return false; } // This method is supposed to be used in the `wp_ajax_tcb_editor_ajax` action. if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), \TCB_Editor_Ajax::NONCE_KEY ) ) { return false; } $editorPostId = ! empty( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; if ( $editorPostId !== $postId ) { return false; } return ! empty( $_REQUEST['aioseo_limit_modified_date'] ) && 'true' === $_REQUEST['aioseo_limit_modified_date']; } }