| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit( 'Direct\'s not allowed' ); |
| 4 |
} |
| 5 |
|
| 6 |
add_filter( 'cf7d_entry_value', 'filter_cf7d_entry_value', 10, 3 ); |
| 7 |
if ( ! function_exists( 'filter_cf7d_entry_value' ) ) { |
| 8 |
function filter_cf7d_entry_value( $value, $name ) { |
| 9 |
$value = preg_replace( "/\r?\n|\r/", '', $value ); |
| 10 |
return $value; |
| 11 |
} |
| 12 |
} |
| 13 |
add_filter( 'cf7d_ad_before_printing_data', 'filter_cf7d_ad_before_printing_data', 10, 2 ); |
| 14 |
if ( ! function_exists( 'filter_cf7d_ad_before_printing_data' ) ) { |
| 15 |
function filter_cf7d_ad_before_printing_data( $data, $fid ) { |
| 16 |
foreach ( $data as $k => $v ) { |
| 17 |
$data[ $k ]['data_id'] = $k; |
| 18 |
} |
| 19 |
return $data; |
| 20 |
} |
| 21 |
} |
| 22 |
add_filter( 'cf7d_admin_fields', 'filter_cf7d_admin_fields', 10, 2 ); |
| 23 |
if ( ! function_exists( 'filter_cf7d_admin_fields' ) ) { |
| 24 |
function filter_cf7d_admin_fields( $fields, $fid ) { |
| 25 |
return array( 'data_id' => 'ID' ) + $fields; |
| 26 |
} |
| 27 |
} |
| 28 |
|