nf_output_field_settings_html

When a field settings metabox is expanded, return a JSON element containing the field settings HTML.

Description

nf_output_field_settings_html(); 

Usage

  1. if ( !function_exists( 'nf_output_field_settings_html' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/ajax.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = nf_output_field_settings_html(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/deprecated/includes/admin/ajax.php  
  1. function nf_output_field_settings_html() { 
  2. global $nf_rte_editors; 
  3.  
  4. // Bail if we aren't in the admin 
  5. if ( ! is_admin() ) 
  6. return false; 
  7.  
  8. // Bail if we don't have proper permissions 
  9. if ( ! current_user_can( apply_filters( 'nf_new_field_capabilities', 'manage_options' ) ) ) 
  10. return false; 
  11.  
  12. check_ajax_referer( 'nf_ajax', 'nf_ajax_nonce' ); 
  13.  
  14. $field_id = esc_html( $_REQUEST['field_id'] ); 
  15. $data = isset ( $_REQUEST['data'] ) ? json_decode( stripslashes( $_REQUEST['data'] ), true ) : array(); 
  16.  
  17. $field = ninja_forms_get_field_by_id( $field_id ); 
  18. $field_data = $field['data']; 
  19. $data = wp_parse_args( $data, $field_data ); 
  20.  
  21. nf_output_registered_field_settings( $field_id, $data ); 
  22.  
  23. die();