ninja_forms_register_tab

The Ninja Forms ninja forms register tab function.

Description

ninja_forms_register_tab( $slug, $args ); 

Parameters (2)

0. $slug
The slug.
1. $args
The args.

Usage

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

Defined (1)

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

/deprecated/includes/register.php  
  1. function ninja_forms_register_tab( $slug, $args ) { 
  2. global $ninja_forms_tabs; 
  3.  
  4. if(!is_array($ninja_forms_tabs)) { 
  5. $ninja_forms_tabs = array(); 
  6.  
  7. $defaults = array( 
  8. 'active_class' => '',  
  9. 'add_form_id' => true,  
  10. 'disable_no_form_id' => false,  
  11. 'display_function' => '',  
  12. 'inactive_class' => '',  
  13. 'name' => '',  
  14. 'page' => '',  
  15. 'save_function' => '',  
  16. 'show_on_no_form_id' => true,  
  17. 'show_save' => true,  
  18. 'show_tab_links' => true,  
  19. 'show_this_tab_link' => true,  
  20. 'tab_reload' => false,  
  21. ); 
  22.  
  23. // Parse incomming $args into an array and merge it with $defaults 
  24. $args = wp_parse_args( $args, $defaults ); 
  25.  
  26. $page = $args['page']; 
  27.  
  28. foreach( $args as $key => $val ) { 
  29. $ninja_forms_tabs[$page][$slug][$key] = $val;