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: textarea.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
** A base module for [textarea] and [textarea*]
[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_textarea', 10, 0 );
[7] Fix | Delete
[8] Fix | Delete
function wpcf7_add_form_tag_textarea() {
[9] Fix | Delete
wpcf7_add_form_tag( array( 'textarea', 'textarea*' ),
[10] Fix | Delete
'wpcf7_textarea_form_tag_handler', array( 'name-attr' => true )
[11] Fix | Delete
);
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
function wpcf7_textarea_form_tag_handler( $tag ) {
[15] Fix | Delete
if ( empty( $tag->name ) ) {
[16] Fix | Delete
return '';
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
$validation_error = wpcf7_get_validation_error( $tag->name );
[20] Fix | Delete
[21] Fix | Delete
$class = wpcf7_form_controls_class( $tag->type );
[22] Fix | Delete
[23] Fix | Delete
if ( $validation_error ) {
[24] Fix | Delete
$class .= ' wpcf7-not-valid';
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
$atts = array();
[28] Fix | Delete
[29] Fix | Delete
$atts['cols'] = $tag->get_cols_option( '40' );
[30] Fix | Delete
$atts['rows'] = $tag->get_rows_option( '10' );
[31] Fix | Delete
$atts['maxlength'] = $tag->get_maxlength_option( '2000' );
[32] Fix | Delete
$atts['minlength'] = $tag->get_minlength_option();
[33] Fix | Delete
[34] Fix | Delete
if ( $atts['maxlength'] and $atts['minlength']
[35] Fix | Delete
and $atts['maxlength'] < $atts['minlength'] ) {
[36] Fix | Delete
unset( $atts['maxlength'], $atts['minlength'] );
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
$atts['class'] = $tag->get_class_option( $class );
[40] Fix | Delete
$atts['id'] = $tag->get_id_option();
[41] Fix | Delete
$atts['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true );
[42] Fix | Delete
$atts['readonly'] = $tag->has_option( 'readonly' );
[43] Fix | Delete
[44] Fix | Delete
$atts['autocomplete'] = $tag->get_option(
[45] Fix | Delete
'autocomplete', '[-0-9a-zA-Z]+', true
[46] Fix | Delete
);
[47] Fix | Delete
[48] Fix | Delete
if ( $tag->is_required() ) {
[49] Fix | Delete
$atts['aria-required'] = 'true';
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
if ( $validation_error ) {
[53] Fix | Delete
$atts['aria-invalid'] = 'true';
[54] Fix | Delete
$atts['aria-describedby'] = wpcf7_get_validation_error_reference(
[55] Fix | Delete
$tag->name
[56] Fix | Delete
);
[57] Fix | Delete
} else {
[58] Fix | Delete
$atts['aria-invalid'] = 'false';
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
$value = empty( $tag->content )
[62] Fix | Delete
? (string) reset( $tag->values )
[63] Fix | Delete
: $tag->content;
[64] Fix | Delete
[65] Fix | Delete
if ( $tag->has_option( 'placeholder' )
[66] Fix | Delete
or $tag->has_option( 'watermark' ) ) {
[67] Fix | Delete
$atts['placeholder'] = $value;
[68] Fix | Delete
$value = '';
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
$value = $tag->get_default_option( $value );
[72] Fix | Delete
[73] Fix | Delete
$value = wpcf7_get_hangover( $tag->name, $value );
[74] Fix | Delete
[75] Fix | Delete
$atts['name'] = $tag->name;
[76] Fix | Delete
[77] Fix | Delete
$html = sprintf(
[78] Fix | Delete
'<span class="wpcf7-form-control-wrap" data-name="%1$s"><textarea %2$s>%3$s</textarea>%4$s</span>',
[79] Fix | Delete
esc_attr( $tag->name ),
[80] Fix | Delete
wpcf7_format_atts( $atts ),
[81] Fix | Delete
esc_textarea( $value ),
[82] Fix | Delete
$validation_error
[83] Fix | Delete
);
[84] Fix | Delete
[85] Fix | Delete
return $html;
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
[89] Fix | Delete
add_action(
[90] Fix | Delete
'wpcf7_swv_create_schema',
[91] Fix | Delete
'wpcf7_swv_add_textarea_rules',
[92] Fix | Delete
10, 2
[93] Fix | Delete
);
[94] Fix | Delete
[95] Fix | Delete
function wpcf7_swv_add_textarea_rules( $schema, $contact_form ) {
[96] Fix | Delete
$tags = $contact_form->scan_form_tags( array(
[97] Fix | Delete
'basetype' => array( 'textarea' ),
[98] Fix | Delete
) );
[99] Fix | Delete
[100] Fix | Delete
foreach ( $tags as $tag ) {
[101] Fix | Delete
if ( $tag->is_required() ) {
[102] Fix | Delete
$schema->add_rule(
[103] Fix | Delete
wpcf7_swv_create_rule( 'required', array(
[104] Fix | Delete
'field' => $tag->name,
[105] Fix | Delete
'error' => wpcf7_get_message( 'invalid_required' ),
[106] Fix | Delete
) )
[107] Fix | Delete
);
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
if ( $minlength = $tag->get_minlength_option() ) {
[111] Fix | Delete
$schema->add_rule(
[112] Fix | Delete
wpcf7_swv_create_rule( 'minlength', array(
[113] Fix | Delete
'field' => $tag->name,
[114] Fix | Delete
'threshold' => absint( $minlength ),
[115] Fix | Delete
'error' => wpcf7_get_message( 'invalid_too_short' ),
[116] Fix | Delete
) )
[117] Fix | Delete
);
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
if ( $maxlength = $tag->get_maxlength_option( '2000' ) ) {
[121] Fix | Delete
$schema->add_rule(
[122] Fix | Delete
wpcf7_swv_create_rule( 'maxlength', array(
[123] Fix | Delete
'field' => $tag->name,
[124] Fix | Delete
'threshold' => absint( $maxlength ),
[125] Fix | Delete
'error' => wpcf7_get_message( 'invalid_too_long' ),
[126] Fix | Delete
) )
[127] Fix | Delete
);
[128] Fix | Delete
}
[129] Fix | Delete
}
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
[133] Fix | Delete
/* Tag generator */
[134] Fix | Delete
[135] Fix | Delete
add_action( 'wpcf7_admin_init', 'wpcf7_add_tag_generator_textarea', 20, 0 );
[136] Fix | Delete
[137] Fix | Delete
function wpcf7_add_tag_generator_textarea() {
[138] Fix | Delete
$tag_generator = WPCF7_TagGenerator::get_instance();
[139] Fix | Delete
$tag_generator->add( 'textarea', __( 'text area', 'contact-form-7' ),
[140] Fix | Delete
'wpcf7_tag_generator_textarea' );
[141] Fix | Delete
}
[142] Fix | Delete
[143] Fix | Delete
function wpcf7_tag_generator_textarea( $contact_form, $args = '' ) {
[144] Fix | Delete
$args = wp_parse_args( $args, array() );
[145] Fix | Delete
$type = 'textarea';
[146] Fix | Delete
[147] Fix | Delete
$description = __( "Generate a form-tag for a multi-line text input field. For more details, see %s.", 'contact-form-7' );
[148] Fix | Delete
[149] Fix | Delete
$desc_link = wpcf7_link( __( 'https://contactform7.com/text-fields/', 'contact-form-7' ), __( 'Text fields', 'contact-form-7' ) );
[150] Fix | Delete
[151] Fix | Delete
?>
[152] Fix | Delete
<div class="control-box">
[153] Fix | Delete
<fieldset>
[154] Fix | Delete
<legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend>
[155] Fix | Delete
[156] Fix | Delete
<table class="form-table">
[157] Fix | Delete
<tbody>
[158] Fix | Delete
<tr>
[159] Fix | Delete
<th scope="row"><?php echo esc_html( __( 'Field type', 'contact-form-7' ) ); ?></th>
[160] Fix | Delete
<td>
[161] Fix | Delete
<fieldset>
[162] Fix | Delete
<legend class="screen-reader-text"><?php echo esc_html( __( 'Field type', 'contact-form-7' ) ); ?></legend>
[163] Fix | Delete
<label><input type="checkbox" name="required" /> <?php echo esc_html( __( 'Required field', 'contact-form-7' ) ); ?></label>
[164] Fix | Delete
</fieldset>
[165] Fix | Delete
</td>
[166] Fix | Delete
</tr>
[167] Fix | Delete
[168] Fix | Delete
<tr>
[169] Fix | Delete
<th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' ) ); ?></label></th>
[170] Fix | Delete
<td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td>
[171] Fix | Delete
</tr>
[172] Fix | Delete
[173] Fix | Delete
<tr>
[174] Fix | Delete
<th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Default value', 'contact-form-7' ) ); ?></label></th>
[175] Fix | Delete
<td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /><br />
[176] Fix | Delete
<label><input type="checkbox" name="placeholder" class="option" /> <?php echo esc_html( __( 'Use this text as the placeholder of the field', 'contact-form-7' ) ); ?></label></td>
[177] Fix | Delete
</tr>
[178] Fix | Delete
[179] Fix | Delete
<tr>
[180] Fix | Delete
<th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th>
[181] Fix | Delete
<td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td>
[182] Fix | Delete
</tr>
[183] Fix | Delete
[184] Fix | Delete
<tr>
[185] Fix | Delete
<th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th>
[186] Fix | Delete
<td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td>
[187] Fix | Delete
</tr>
[188] Fix | Delete
[189] Fix | Delete
</tbody>
[190] Fix | Delete
</table>
[191] Fix | Delete
</fieldset>
[192] Fix | Delete
</div>
[193] Fix | Delete
[194] Fix | Delete
<div class="insert-box">
[195] Fix | Delete
<input type="text" name="<?php echo $type; ?>" class="tag code" readonly="readonly" onfocus="this.select()" />
[196] Fix | Delete
[197] Fix | Delete
<div class="submitbox">
[198] Fix | Delete
<input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" />
[199] Fix | Delete
</div>
[200] Fix | Delete
[201] Fix | Delete
<br class="clear" />
[202] Fix | Delete
[203] Fix | Delete
<p class="description mail-tag"><label for="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"><?php echo sprintf( esc_html( __( "To use the value input through this field in a mail field, you need to insert the corresponding mail-tag (%s) into the field on the Mail tab.", 'contact-form-7' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?><input type="text" class="mail-tag code hidden" readonly="readonly" id="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>" /></label></p>
[204] Fix | Delete
</div>
[205] Fix | Delete
<?php
[206] Fix | Delete
}
[207] Fix | Delete
[208] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function