| Server IP : 68.183.124.220 / Your IP : 216.73.216.141 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/ninja-forms/deprecated/includes/admin/edit-field/ |
Upload File : |
<?php if ( ! defined( 'ABSPATH' ) ) exit;
add_action('init', 'ninja_forms_register_edit_field_help');
function ninja_forms_register_edit_field_help(){
add_action('ninja_forms_edit_field_after_registered', 'ninja_forms_edit_field_help', 10, 2 );
}
function ninja_forms_edit_field_help( $field_id, $field_data ) {
global $ninja_forms_fields;
$field_row = ninja_forms_get_field_by_id($field_id);
$field_type = $field_row['type'];
$reg_field = $ninja_forms_fields[$field_type];
$edit_help = $reg_field['edit_help'];
if($edit_help){
if(isset($field_data['help_text'])){
$help_text = $field_data['help_text'];
}else{
$help_text = '';
}
if(isset($field_data['show_help'])){
$show_help = $field_data['show_help'];
}else{
$show_help = '';
}
if( $show_help == 1 ){
$display_span = '';
}else{
$display_span = 'display:none;';
}
$help_desc = sprintf( __( 'If "help text" is enabled, there will be a question mark %s placed next to the input field. Hovering over this question mark will show the help text.', 'ninja-forms' ), '<img src="'.NINJA_FORMS_URL.'images/question-ico.gif">') ;
ninja_forms_edit_field_el_output($field_id, 'checkbox', __( 'Show Help Text', 'ninja-forms' ), 'show_help', $show_help, 'wide', '', 'ninja-forms-show-help');
?>
<span id="ninja_forms_field_<?php echo $field_id;?>_help_span" style="<?php echo $display_span;?>">
<?php
ninja_forms_edit_field_el_output($field_id, 'textarea', __( 'Help Text', 'ninja-forms' ), 'help_text', $help_text, 'wide', '', 'widefat');
ninja_forms_edit_field_el_output($field_id, 'desc', $help_desc, 'help_desc');
?>
</span>
<?php
}
}