ActionScheduler_Store::validate_args()protectedWC 1.0

Validate that we could decode action arguments.

Метод класса: ActionScheduler_Store{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->validate_args( $args, $action_id );
$args(разное) (обязательный)
The decoded arguments.
$action_id(int) (обязательный)
The action ID.

Код ActionScheduler_Store::validate_args() WC 8.7.0

protected function validate_args( $args, $action_id ) {
	// Ensure we have an array of args.
	if ( ! is_array( $args ) ) {
		throw ActionScheduler_InvalidActionException::from_decoding_args( $action_id );
	}

	// Validate JSON decoding if possible.
	if ( function_exists( 'json_last_error' ) && JSON_ERROR_NONE !== json_last_error() ) {
		throw ActionScheduler_InvalidActionException::from_decoding_args( $action_id, $args );
	}
}