

add_action( 'wpcf7_init', 'wpcf7_add_form_tag_count', 10, 0 );

function wpcf7_add_form_tag_count() {
	wpcf7_add_form_tag( 'count',
		'wpcf7_count_form_tag_handler',
		array(
			'name-attr' => true,
			'zero-controls-container' => true,
			'not-for-mail' => true,
		)
	);
}

function wpcf7_count_form_tag_handler( $tag ) {
	if ( empty( $tag->name ) ) {
		return '';
	}

	$targets = wpcf7_scan_form_tags( array( 'name' => $tag->name ) );
	$maxlength = $minlength = null;

	while ( $targets ) {
		$target = array_shift( $targets );

		if ( 'count' != $target->type ) {
			$maxlength = $target->get_maxlength_option();
			$minlength = $target->get_minlength_option();
			break;
		}
	}

	if ( $maxlength and $minlength
	and $maxlength < $minlength ) {
		$maxlength = $minlength = null;
	}

	if ( $tag->has_option( 'down' ) ) {
		$value = (int) $maxlength;
		$class = 'wpcf7-character-count down';
	} else {
		$value = '0';
		$class = 'wpcf7-character-count up';
	}

	$atts = array();

	$atts['id'] = $tag->get_id_option();
	$atts['class'] = $tag->get_class_option( $class );
	$atts['data-target-name'] = $tag->name;
	$atts['data-starting-value'] = $value;
	$atts['data-current-value'] = $value;
	$atts['data-maximum-value'] = $maxlength;
	$atts['data-minimum-value'] = $minlength;

	$html = sprintf(
		'<span %1$s>%2$s</span>',
		wpcf7_format_atts( $atts ),
		$value
	);

	return $html;
}
<?xml version="1.0"?>
<oembed><version>1.0</version><provider_name>FlySIP SoftSwitch</provider_name><provider_url>https://flysip.com/ru/</provider_url><author_name>admin</author_name><author_url>https://flysip.com/ru/author/admin/</author_url><title>&#x410;&#x440;&#x435;&#x43D;&#x434;&#x430; &#x438; &#x43F;&#x440;&#x43E;&#x434;&#x430;&#x436; SoftSwit&#x441;h</title><type>rich</type><width>600</width><height>338</height><html>&lt;blockquote class="wp-embedded-content" data-secret="8ECKFtrl6d"&gt;&lt;a href="https://flysip.com/ru/"&gt;&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;&lt;/a&gt;&lt;/blockquote&gt;&lt;iframe sandbox="allow-scripts" security="restricted" src="https://flysip.com/ru/embed/#?secret=8ECKFtrl6d" width="600" height="338" title="&#xAB;&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;&#xBB; &#x2014; FlySIP SoftSwitch" data-secret="8ECKFtrl6d" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"&gt;&lt;/iframe&gt;&lt;script type="text/javascript"&gt;
/* &lt;![CDATA[ */
/*! This file is auto-generated */
!function(d,l){"use strict";l.querySelector&amp;&amp;d.addEventListener&amp;&amp;"undefined"!=typeof URL&amp;&amp;(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&amp;&amp;!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i&lt;o.length;i++)o[i].style.display="none";for(i=0;i&lt;a.length;i++)s=a[i],e.source===s.contentWindow&amp;&amp;(s.removeAttribute("style"),"height"===t.message?(1e3&lt;(r=parseInt(t.value,10))?r=1e3:~~r&lt;200&amp;&amp;(r=200),s.height=r):"link"===t.message&amp;&amp;(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&amp;&amp;n.host===r.host&amp;&amp;l.activeElement===s&amp;&amp;(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r&lt;s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document);
//# sourceURL=https://flysip.com/wp-includes/js/wp-embed.min.js
/* ]]&gt; */
&lt;/script&gt;
</html><description>&#x423; &#x43D;&#x430;&#x441; 4/5 &#x43A;&#x43B;&#x430;&#x441;&#x441; SoftSwit&#x441;h &#x434;&#x43B;&#x44F; &#x432;&#x441;&#x435;&#x445; &#x442;&#x438;&#x43F;&#x43E;&#x432; &#x43A;&#x43B;&#x438;&#x435;&#x43D;&#x442;&#x43E;&#x432; &#x2013; &#x43E;&#x442; &#x43D;&#x435;&#x431;&#x43E;&#x43B;&#x44C;&#x448;&#x438;&#x445; &#x43F;&#x43E;&#x43B;&#x44C;&#x437;&#x43E;&#x432;&#x430;&#x442;&#x435;&#x43B;&#x435;&#x439; &#x434;&#x43B;&#x44F; &#x431;&#x438;&#x437;&#x43D;&#x435;&#x441;&#x430; &#x434;&#x43E; &#x43E;&#x43F;&#x442;&#x43E;&#x432;&#x44B;&#x445; &#x43A;&#x43B;&#x438;&#x435;&#x43D;&#x442;&#x43E;&#x432; &#x441; &#x442;&#x44B;&#x441;&#x44F;&#x447;&#x430;&#x43C;&#x438; &#x43A;&#x430;&#x43D;&#x430;&#x43B;&#x43E;&#x432;</description><thumbnail_url>https://flysip.com/wp-content/uploads/2023/06/flysip-image-3.jpg</thumbnail_url><thumbnail_width>2000</thumbnail_width><thumbnail_height>1500</thumbnail_height></oembed>
