wpcf7_swv_add_select_rules()CF7 1.0

Хуков нет.

Возвращает

null. Ничего.

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

wpcf7_swv_add_select_rules( $schema, $contact_form );
$schema (обязательный)
-
$contact_form (обязательный)
-

Код wpcf7_swv_add_select_rules() CF7 5.6.2

function wpcf7_swv_add_select_rules( $schema, $contact_form ) {
	$tags = $contact_form->scan_form_tags( array(
		'type' => array( 'select*' ),
	) );

	foreach ( $tags as $tag ) {
		$schema->add_rule(
			wpcf7_swv_create_rule( 'required', array(
				'field' => $tag->name,
				'error' => wpcf7_get_message( 'invalid_required' ),
			) )
		);
	}
}