Validates a template tag arguments definition.
Description
See also
Parameters
- $tag_args_definition
-
(array) (Required) Template tag callback arguments definition as an array of scalar $type values.
Return
(array) Validated template tag callback arguments definition.
Source
File: src/components/template-tag-handler.php
private function validate_tag_args_definition( $tag_args_definition ) { foreach ( $tag_args_definition as $type ) { switch ( $type ) { case 'string': case 'int': case 'float': case 'bool': break; default: if ( ! class_exists( $type ) && ! interface_exists( $type ) ) { /* translators: %s: template tag handler slug */ throw new InvalidArgumentException( sprintf( __( 'Invalid template tag arguments definition for handler %s.', 'torro-forms' ), $this->slug ) ); } } } return $tag_args_definition; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |