👁 查看:any.php
路径:/home/forge/kingkrunch.com/wp/wp-content/plugins/contact-form-7/includes/swv/php/rules/any.php
大小:503 B · 修改:2026-08-18 00:42:40 · 权限:0644 · 可写
<?php

namespace Contactable\SWV;

class AnyRule extends CompositeRule {

	const rule_name = 'any';

	public function matches( $context ) {
		if ( false === parent::matches( $context ) ) {
			return false;
		}

		return true;
	}

	public function validate( $context ) {
		foreach ( $this->rules() as $rule ) {
			if ( $rule->matches( $context ) ) {
				$result = $rule->validate( $context );

				if ( ! is_wp_error( $result ) ) {
					return true;
				}
			}
		}

		return $this->create_error();
	}

}