pmpro_license_nag

The Paid Memberships Pro pmpro license nag function.

Description

pmpro_license_nag(); 

Usage

  1. if ( !function_exists( 'pmpro_license_nag' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/license.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmpro_license_nag(); 
  7.  

Defined (1)

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

/includes/license.php  
  1. function pmpro_license_nag() { 
  2. global $pmpro_nagged; 
  3.  
  4. //nagged already? 
  5. if(!empty($pmpro_nagged)) 
  6. return; 
  7.  
  8. //remember that we've nagged already 
  9. $pmpro_nagged = true; 
  10.  
  11. //blocked by constant? 
  12. if(defined('PMPRO_LICENSE_NAG') && !PMPRO_LICENSE_NAG) 
  13. return; 
  14.  
  15. //don't load on the license page 
  16. if(!empty($_REQUEST['page']) && $_REQUEST['page'] == 'pmpro_license_settings') 
  17. return; 
  18.  
  19. //valid license? 
  20. if(pmpro_license_isValid()) 
  21. return; 
  22.  
  23. //always show on updates page 
  24. /** 
  25. $screen = get_current_screen();  
  26. if($screen->id == 'update-core') 
  27. $pmpro_nag_paused = false;  
  28. else 
  29. */ 
  30. $pmpro_nag_paused = get_option('pmpro_nag_paused', 0);  
  31.  
  32. if(current_time('timestamp') < $pmpro_nag_paused && $pmpro_nag_paused < current_time('timestamp')*3600*24*8) 
  33. return; 
  34.  
  35. //okay, show nag  
  36. ?> 
  37. <div class="error fade"> 
  38. <p> 
  39. <strong><?php _e('Invalid PMPro License Key.', 'paid-memberships-pro' );?></strong> <?php _e("If you're running Paid Memberships Pro on a production website, we recommend an annual support license.", 'paid-memberships-pro' );?> 
  40. <a href="<?php echo admin_url('options-general.php?page=pmpro_license_settings');?>"><?php _e('More Info', 'paid-memberships-pro' );?></a> | <a href="<?php echo add_query_arg('pmpro_nag_paused', '1', $_SERVER['REQUEST_URI']);?>"><?php _e('Dismiss', 'paid-memberships-pro' );?></a> 
  41. </p> 
  42. </div> 
  43. <?php