ninja_forms_register_screen_option

The Ninja Forms ninja forms register screen option function.

Description

ninja_forms_register_screen_option( $id, $args ); 

Parameters (2)

0. $id
The id.
1. $args
The args.

Usage

  1. if ( !function_exists( 'ninja_forms_register_screen_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/register.php'; 
  3.  
  4. // The id. 
  5. $id = null; 
  6.  
  7. // The args. 
  8. $args = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = ninja_forms_register_screen_option($id, $args); 
  12.  

Defined (1)

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

/deprecated/includes/register.php  
  1. function ninja_forms_register_screen_option( $id, $args ) { 
  2. global $ninja_forms_screen_options; 
  3.  
  4. $defaults = array( 
  5. 'display_function' => '',  
  6. 'order' => '',  
  7. 'page' => '',  
  8. 'save_function' => '',  
  9. 'tab' => '',  
  10. ); 
  11.  
  12. // Parse incomming $args into an array and merge it with $defaults 
  13. $args = wp_parse_args( $args, $defaults ); 
  14.  
  15. extract( $args ); 
  16.  
  17. if($page == '' AND $tab == '') { 
  18. $ninja_forms_screen_options['_universal_'][$id]['display_function'] = $display_function; 
  19. $ninja_forms_screen_options['_universal_'][$id]['save_function'] = $save_function; 
  20. }elseif($page != '' AND $tab == '') { 
  21. $ninja_forms_screen_options[$page]['_universal_'][$id]['display_function'] = $display_function; 
  22. $ninja_forms_screen_options[$page]['_universal_'][$id]['save_function'] = $save_function; 
  23. }elseif($page != '' AND $tab != '') { 
  24. $ninja_forms_screen_options[$page][$tab][$id]['display_function'] = $display_function; 
  25. $ninja_forms_screen_options[$page][$tab][$id]['save_function'] = $save_function;