WPCF7_SWV_Schema{}
The schema class as a composite rule.
Хуков нет.
Использование
$WPCF7_SWV_Schema = new WPCF7_SWV_Schema(); // use class methods
Методы
- public __construct( $properties = '' )
- public validate( $context )
Код WPCF7_SWV_Schema{} WPCF7 SWV Schema{} CF7 5.9.3
class WPCF7_SWV_Schema extends \Contactable\SWV\CompositeRule { /** * The human-readable version of the schema. */ const version = 'Contact Form 7 SWV Schema 2024-02'; /** * Constructor. */ public function __construct( $properties = '' ) { $this->properties = wp_parse_args( $properties, array( 'version' => self::version, ) ); } /** * Validates with this schema. * * @param array $context Context. */ public function validate( $context ) { foreach ( $this->rules() as $rule ) { if ( $rule->matches( $context ) ) { yield $rule->validate( $context ); } } } }