wpcf7_tag_generator_acceptance()CF7 1.0

Хуков нет.

Возвращает

null. Ничего (null).

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

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

Код wpcf7_tag_generator_acceptance() CF7 6.0.5

<?php
function wpcf7_tag_generator_acceptance( $contact_form, $options ) {
	$field_types = array(
		'acceptance' => array(
			'display_name' => __( 'Acceptance checkbox', 'contact-form-7' ),
			'heading' => __( 'Acceptance checkbox form-tag generator', 'contact-form-7' ),
			'description' => __( 'Generates a form-tag for an <a href="https://contactform7.com/acceptance-checkbox/">acceptance checkbox</a>.', 'contact-form-7' ),
		),
	);

	$tgg = new WPCF7_TagGeneratorGenerator( $options['content'] );

?>
<header class="description-box">
	<h3><?php
		echo esc_html( $field_types['acceptance']['heading'] );
	?></h3>

	<p><?php
		$description = wp_kses(
			$field_types['acceptance']['description'],
			array(
				'a' => array( 'href' => true ),
				'strong' => array(),
			),
			array( 'http', 'https' )
		);

		echo $description;
	?></p>
</header>

<div class="control-box">
	<fieldset>
		<legend id="<?php echo esc_attr( $tgg->ref( 'type-legend' ) ); ?>"><?php
			echo esc_html( __( 'Field type', 'contact-form-7' ) );
		?></legend>

		<select data-tag-part="basetype" aria-labelledby="<?php echo esc_attr( $tgg->ref( 'type-legend' ) ); ?>"><?php
			echo sprintf(
				'<option %1$s>%2$s</option>',
				wpcf7_format_atts( array(
					'value' => 'acceptance',
				) ),
				esc_html( $field_types['acceptance']['display_name'] )
			);
		?></select>
		<br />
		<label>
			<input type="checkbox" data-tag-part="option" data-tag-option="optional" checked="checked" />
			<?php echo esc_html( __( "This checkbox is optional.", 'contact-form-7' ) ); ?>
		</label>
	</fieldset>

	<?php
		$tgg->print( 'field_name' );

		$tgg->print( 'class_attr' );
	?>

	<fieldset>
		<legend id="<?php echo esc_attr( $tgg->ref( 'value-legend' ) ); ?>"><?php
			echo esc_html( __( 'Condition', 'contact-form-7' ) );
		?></legend>
		<?php
			echo sprintf(
				'<input %s />',
				wpcf7_format_atts( array(
					'type' => 'text',
					'required' => true,
					'value' => __( 'Put the condition for consent here.', 'contact-form-7' ),
					'data-tag-part' => 'content',
					'aria-labelledby' => $tgg->ref( 'value-legend' ),
				) )
			);
		?>
	</fieldset>
</div>

<footer class="insert-box">
	<?php
		$tgg->print( 'insert_box_content' );

		$tgg->print( 'mail_tag_tip' );
	?>
</footer>
<?php
}