Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../includes/Fields
File: Textarea.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Class NF_Field_Textarea
[3] Fix | Delete
*/
[4] Fix | Delete
class NF_Fields_Textarea extends NF_Abstracts_Input
[5] Fix | Delete
{
[6] Fix | Delete
protected $_name = 'textarea';
[7] Fix | Delete
[8] Fix | Delete
protected $_section = 'common';
[9] Fix | Delete
[10] Fix | Delete
protected $_icon = 'paragraph';
[11] Fix | Delete
[12] Fix | Delete
protected $_type = 'textarea';
[13] Fix | Delete
[14] Fix | Delete
protected $_templates = 'textarea';
[15] Fix | Delete
[16] Fix | Delete
protected $_test_value = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.';
[17] Fix | Delete
[18] Fix | Delete
protected $_settings = array( 'input_limit_set', 'rte_enable', 'rte_media', 'rte_mobile', 'disable_browser_autocomplete', 'textarea_rte', 'disable_rte_mobile', 'textarea_media', );
[19] Fix | Delete
[20] Fix | Delete
public function __construct()
[21] Fix | Delete
{
[22] Fix | Delete
parent::__construct();
[23] Fix | Delete
[24] Fix | Delete
$this->_nicename = esc_html__( 'Paragraph Text', 'ninja-forms' );
[25] Fix | Delete
[26] Fix | Delete
$this->_settings[ 'default' ][ 'type' ] = 'textarea';
[27] Fix | Delete
$this->_settings[ 'placeholder' ][ 'type' ] = 'textarea';
[28] Fix | Delete
[29] Fix | Delete
add_filter( 'ninja_forms_subs_export_field_value_' . $this->_name, array( $this, 'filter_csv_value' ), 10, 2 );
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
public function admin_form_element( $id, $value )
[33] Fix | Delete
{
[34] Fix | Delete
return "<textarea class='widefat' name='fields[$id]'>$value</textarea>";
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public function filter_csv_value( $field_value, $field ) {
[38] Fix | Delete
[39] Fix | Delete
/*
[40] Fix | Delete
* sanitize this in case someone tries to inject data that runs in
[41] Fix | Delete
* Excel and similar apps
[42] Fix | Delete
* */
[43] Fix | Delete
if( 0 < strlen($field_value ) ) {
[44] Fix | Delete
$first_char = substr( $field_value, 0, 1 );
[45] Fix | Delete
if( in_array( $first_char, array( '=', '@', '+', '-' ) ) ) {
[46] Fix | Delete
return "'" . $field_value;
[47] Fix | Delete
}
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
return $field_value;
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function