Commit 44431744 authored by Kevin Stover's avatar Kevin Stover

Changed help.php so that it gets $data passed to it rather than getting the...

Changed help.php so that it gets $data passed to it rather than getting the field settings $data from the database. This makes it possible to modify the help_text and show_help using the ninja_forms_field filter.
parent bbf830a5
......@@ -3,17 +3,10 @@
* Outputs the HTML of the help icon if it is set to display.
*
**/
add_action('init', 'ninja_forms_register_display_field_help');
function ninja_forms_register_display_field_help(){
add_action( 'ninja_forms_display_field_help', 'ninja_forms_display_field_help' );
}
function ninja_forms_display_field_help( $field_id ){
function ninja_forms_display_field_help( $field_id, $data ){
$plugin_settings = get_option( 'ninja_forms_settings' );
$field_row = ninja_forms_get_field_by_id( $field_id );
$data = $field_row['data'];
if( isset( $data['show_help'] ) ){
$show_help = $data['show_help'];
}else{
......@@ -26,11 +19,11 @@ function ninja_forms_display_field_help( $field_id ){
$help_text = '';
}
if($show_help){
?>
<img id="" class='ninja-forms-help-text' src="<?php echo NINJA_FORMS_URL;?>/images/question-ico.gif" title="<?php echo $help_text;?>">
<?php
}
}
\ No newline at end of file
}
add_action( 'ninja_forms_display_field_help', 'ninja_forms_display_field_help', 10, 2 );
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment