Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/contact-.../modules
File: count.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
** A base module for [count], Twitter-like character count
[2] Fix | Delete
**/
[3] Fix | Delete
[4] Fix | Delete
/* form_tag handler */
[5] Fix | Delete
[6] Fix | Delete
add_action( 'wpcf7_init', 'wpcf7_add_form_tag_count', 10, 0 );
[7] Fix | Delete
[8] Fix | Delete
function wpcf7_add_form_tag_count() {
[9] Fix | Delete
wpcf7_add_form_tag( 'count',
[10] Fix | Delete
'wpcf7_count_form_tag_handler',
[11] Fix | Delete
array(
[12] Fix | Delete
'name-attr' => true,
[13] Fix | Delete
'zero-controls-container' => true,
[14] Fix | Delete
'not-for-mail' => true,
[15] Fix | Delete
)
[16] Fix | Delete
);
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
function wpcf7_count_form_tag_handler( $tag ) {
[20] Fix | Delete
if ( empty( $tag->name ) ) {
[21] Fix | Delete
return '';
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
$targets = wpcf7_scan_form_tags( array( 'name' => $tag->name ) );
[25] Fix | Delete
$maxlength = $minlength = null;
[26] Fix | Delete
[27] Fix | Delete
while ( $targets ) {
[28] Fix | Delete
$target = array_shift( $targets );
[29] Fix | Delete
[30] Fix | Delete
if ( 'count' != $target->type ) {
[31] Fix | Delete
$maxlength = $target->get_maxlength_option();
[32] Fix | Delete
$minlength = $target->get_minlength_option();
[33] Fix | Delete
break;
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
if ( $maxlength and $minlength
[38] Fix | Delete
and $maxlength < $minlength ) {
[39] Fix | Delete
$maxlength = $minlength = null;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
if ( $tag->has_option( 'down' ) ) {
[43] Fix | Delete
$value = (int) $maxlength;
[44] Fix | Delete
$class = 'wpcf7-character-count down';
[45] Fix | Delete
} else {
[46] Fix | Delete
$value = '0';
[47] Fix | Delete
$class = 'wpcf7-character-count up';
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
$atts = array();
[51] Fix | Delete
[52] Fix | Delete
$atts['id'] = $tag->get_id_option();
[53] Fix | Delete
$atts['class'] = $tag->get_class_option( $class );
[54] Fix | Delete
$atts['data-target-name'] = $tag->name;
[55] Fix | Delete
$atts['data-starting-value'] = $value;
[56] Fix | Delete
$atts['data-current-value'] = $value;
[57] Fix | Delete
$atts['data-maximum-value'] = $maxlength;
[58] Fix | Delete
$atts['data-minimum-value'] = $minlength;
[59] Fix | Delete
[60] Fix | Delete
$html = sprintf(
[61] Fix | Delete
'<span %1$s>%2$s</span>',
[62] Fix | Delete
wpcf7_format_atts( $atts ),
[63] Fix | Delete
$value
[64] Fix | Delete
);
[65] Fix | Delete
[66] Fix | Delete
return $html;
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function