LLMS_REST_Students_Progress_Controller::validate_date_created( string $value, WP_REST_Request $request, string $param )

Validate the date_created

Parameters Parameters


(string) (Required) Date string.


(WP_REST_Request) (Required) Request object.


(string) (Required) Parameter name ("post_id").

Top ↑

Return Return


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/server/class-llms-rest-students-progress-controller.php

	public function validate_date_created( $value, $request, $param ) {

		$ts  = rest_parse_date( $value );
		$now = llms_current_time( 'U' );

		if ( $ts > $now ) {
			return llms_rest_bad_request_error( __( 'Created date cannot be in the future.', 'lifterlms' ) );

		return true;

Top ↑

Changelog Changelog

Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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