nf_license_settings_save_button

Output a save button so that we can call it: "Save & Activate".

Description

nf_license_settings_save_button(); 

Usage

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

Defined (1)

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

/deprecated/includes/admin/pages/ninja-forms-settings/tabs/license-settings/license-settings.php  
  1. function nf_license_settings_save_button() { 
  2. global $ninja_forms_tabs_metaboxes; 
  3.  
  4. if ( ! isset ( $ninja_forms_tabs_metaboxes['ninja-forms-settings']['license_settings']['license_settings']['settings'] ) ) 
  5. return false; 
  6.  
  7. $show_save = false; 
  8. $show_deactivate = false; 
  9.  
  10. // Loop through each of our licenses to set which buttons should be shown. 
  11. // We only want to show the "Save & Activate" button if there are no active licenses. 
  12. // We only want to show the "Deactivate All" button if there is at least one active license. 
  13. foreach ( $ninja_forms_tabs_metaboxes['ninja-forms-settings']['license_settings']['license_settings']['settings'] as $setting ) { 
  14. // Check to see if this license is valid. 
  15. $valid = $setting['save_function'][0]->is_valid(); 
  16. // If we get a valid license, show deactivate all. 
  17. if ( $valid ) { 
  18. $show_deactivate = true; 
  19. } else { // If we get an invalid license, show the save button. 
  20. $show_save = true; 
  21.  
  22. if ( $show_save ) { 
  23. ?> 
  24. <input class="button-primary menu-save ninja-forms-save-data" id="ninja_forms_save_data_top" type="submit" value="<?php _e( 'Save & Activate', 'ninja-forms' ); ?>" />  
  25. <?php  
  26.  
  27. if ( $show_deactivate ) { 
  28. ?> 
  29. <input type="submit" class="button-secondary" id="nf_deactivate_all_licenses" name="deactivate_all" value="<?php _e( 'Deactivate All Licenses', 'ninja-forms' ); ?>"> 
  30. <?php