ActionScheduler_Store::validate_args
Validate that we could decode action arguments.
Method of the class: ActionScheduler_Store{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->validate_args( $args, $action_id );
- $args(mixed) (required)
- The decoded arguments.
- $action_id(int) (required)
- The action ID.
ActionScheduler_Store::validate_args() ActionScheduler Store::validate args code WC 10.8.1
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 );
}
}