Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../deprecat.../includes/display/fields
File: desc.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
/**
[1] Fix | Delete
* Outputs the HTML of the description content if it is set to display.
[2] Fix | Delete
*
[3] Fix | Delete
**/
[4] Fix | Delete
[5] Fix | Delete
// add_action( 'init', 'ninja_forms_init_field_desc' );
[6] Fix | Delete
// function ninja_forms_init_field_desc() {
[7] Fix | Delete
// add_action( 'ninja_forms_display_before_field', 'ninja_forms_add_field_desc', 10, 2 );
[8] Fix | Delete
// }
[9] Fix | Delete
[10] Fix | Delete
function ninja_forms_add_field_desc( $field_id, $data ){
[11] Fix | Delete
$plugin_settings = nf_get_settings();
[12] Fix | Delete
[13] Fix | Delete
if ( isset( $data['desc_pos'] ) ) {
[14] Fix | Delete
$desc_pos = $data['desc_pos'];
[15] Fix | Delete
} else {
[16] Fix | Delete
$desc_pos = 'none';
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
if ( $desc_pos == 'none' ) {
[20] Fix | Delete
remove_action( 'ninja_forms_display_after_opening_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[21] Fix | Delete
remove_action( 'ninja_forms_display_before_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[22] Fix | Delete
remove_action( 'ninja_forms_display_after_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[23] Fix | Delete
remove_action( 'ninja_forms_display_before_closing_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[24] Fix | Delete
} elseif ( $desc_pos == 'before_everything' ) {
[25] Fix | Delete
add_action( 'ninja_forms_display_after_opening_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[26] Fix | Delete
remove_action( 'ninja_forms_display_before_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[27] Fix | Delete
remove_action( 'ninja_forms_display_after_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[28] Fix | Delete
remove_action( 'ninja_forms_display_before_closing_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[29] Fix | Delete
} elseif ( $desc_pos == 'before_label' ) {
[30] Fix | Delete
add_action( 'ninja_forms_display_before_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[31] Fix | Delete
remove_action( 'ninja_forms_display_after_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[32] Fix | Delete
remove_action( 'ninja_forms_display_before_closing_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[33] Fix | Delete
remove_action( 'ninja_forms_display_after_opening_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[34] Fix | Delete
} elseif ( $desc_pos == 'after_label' ) {
[35] Fix | Delete
add_action( 'ninja_forms_display_after_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[36] Fix | Delete
remove_action( 'ninja_forms_display_before_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[37] Fix | Delete
remove_action( 'ninja_forms_display_before_closing_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[38] Fix | Delete
remove_action( 'ninja_forms_display_after_opening_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[39] Fix | Delete
} elseif ( $desc_pos == 'after_everything' ) {
[40] Fix | Delete
add_action( 'ninja_forms_display_before_closing_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[41] Fix | Delete
remove_action( 'ninja_forms_display_before_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[42] Fix | Delete
remove_action( 'ninja_forms_display_after_field_label', 'ninja_forms_display_field_desc', 10, 2 );
[43] Fix | Delete
remove_action( 'ninja_forms_display_after_opening_field_wrap', 'ninja_forms_display_field_desc', 10, 2 );
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
}
[47] Fix | Delete
add_action( 'ninja_forms_display_before_field', 'ninja_forms_add_field_desc', 10, 2 );
[48] Fix | Delete
[49] Fix | Delete
function ninja_forms_display_field_desc( $field_id, $data ){
[50] Fix | Delete
$plugin_settings = nf_get_settings();
[51] Fix | Delete
[52] Fix | Delete
$class = apply_filters( 'ninja_forms_display_field_desc_class', 'ninja-forms-field-description', $field_id );
[53] Fix | Delete
[54] Fix | Delete
if ( ( isset( $data['show_desc'] ) and $data['show_desc'] == 1 ) and isset( $data['desc_text'] ) ) {
[55] Fix | Delete
echo '<div class="' . $class . '">';
[56] Fix | Delete
echo do_shortcode( wpautop( $data['desc_text'] ) );
[57] Fix | Delete
echo '</div>';
[58] Fix | Delete
}
[59] Fix | Delete
}
[60] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function