gpr_show_upgrade_notices

Display Upgrade Notices.

Description

gpr_show_upgrade_notices(); 

Usage

  1. if ( !function_exists( 'gpr_show_upgrade_notices' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-places-reviews/inc/upgrades/upgrade-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gpr_show_upgrade_notices(); 
  7.  

Defined (1)

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

/inc/upgrades/upgrade-functions.php  
  1. function gpr_show_upgrade_notices() { 
  2.  
  3. //Uncomment for testing ONLY - Never leave uncommented unless testing: 
  4. //delete_option( 'gpr_refid_upgraded' ); 
  5.  
  6. // Don't show notices on the upgrades page 
  7. if ( isset( $_GET['page'] ) && $_GET['page'] == 'gpr-upgrades' ) { 
  8. return; 
  9.  
  10. $gpr_widget_version = get_option( 'gpr_widget_version' ); 
  11.  
  12. if ( ! $gpr_widget_version ) { 
  13. // 1.3 is the first version to use this option so we must add it 
  14. $gpr_widget_version = '1.3'; 
  15.  
  16. $gpr_widget_version = preg_replace( '/[^0-9.].*/', '', $gpr_widget_version ); 
  17.  
  18. if ( version_compare( $gpr_widget_version, '1.3', '<=' ) && ! get_option( 'gpr_refid_upgraded' ) && is_active_widget( false, false, 'gpr_widget', true ) ) { 
  19. printf( 
  20. '<div class="updated"><p><strong>Google Places Reviews Notice:</strong> ' . esc_html__( 'Hey there! We noticed you have active Google Places Reviews widget(s). Google has updated their API to use the new Google Places ID rather than previous Reference ID, which will soon be deprecated and eventually go offline. We are being proactive and would like to update your widgets to use the new Places ID for you. Once you upgrade, your widgets should work just fine. If you choose not to upgrade Google will eventually take the old reference ID offline (no date has been given). Please contact %1sWordImpress support%2s if you have any further questions or issues. %3sClick here to upgrade your widgets to use the new Places ID%4s.', 'google-places-reviews' ) . '</p></div>',  
  21. '<a href="http://wordpress.org/support/plugin/google-places-reviews" target="_blank">',  
  22. '</a>',  
  23. '<br><br><strong><a href="' . esc_url( admin_url( 'options.php?page=gpr-upgrades' ) ) . '">',  
  24. '</a></strong>' 
  25. ); 
  26.  
  27. update_option( 'gpr_widget_version', GPR_VERSION ); 
  28.  
  29.