ninja_forms_register_exp_fav_fields_metabox

The Ninja Forms ninja forms register exp fav fields metabox function.

Description

ninja_forms_register_exp_fav_fields_metabox(); 

Usage

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

Defined (1)

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

/deprecated/includes/admin/pages/ninja-forms-impexp/tabs/impexp-fields/impexp-fields.php  
  1. function ninja_forms_register_exp_fav_fields_metabox() { 
  2. $fav_results = ninja_forms_get_all_favs(); 
  3. $fav_options = array(); 
  4.  
  5. if ( is_array( $fav_results ) AND !empty( $fav_results ) ) { 
  6. foreach ( $fav_results as $fav ) { 
  7. $data = $fav['data']; 
  8. $label = $data['label']; 
  9. array_push($fav_options, array('name' => $label, 'value' => $fav['id'])); 
  10. $empty = ''; 
  11. } else { 
  12. $empty = __( 'No Favorite Fields Found', 'ninja-forms' ); 
  13. $args = array( 
  14. 'page' => 'ninja-forms-impexp',  
  15. 'tab' => 'impexp_fields',  
  16. 'slug' => 'exp_fields',  
  17. 'title' => __( 'Export Favorite Fields', 'ninja-forms' ),  
  18. 'settings' => array( 
  19. array( 
  20. 'name' => 'ninja_forms_fav',  
  21. 'type' => 'checkbox_list',  
  22. 'label' => '',  
  23. 'desc' => '',  
  24. 'options' => $fav_options,  
  25. 'help_text' => '',  
  26. ),  
  27. array( 
  28. 'name' => '',  
  29. 'type' => 'desc',  
  30. 'label' => $empty,  
  31. ),  
  32. array( 
  33. 'name' => 'submit',  
  34. 'type' => 'submit',  
  35. 'label' => __( 'Export Fields', 'ninja-forms' ),  
  36. 'class' => 'button-secondary',  
  37. ),  
  38. ),  
  39. );