cf7_infusionsoft_admin_notice

Verify CF7 dependencies.

Description

cf7_infusionsoft_admin_notice(); 

Usage

  1. if ( !function_exists( 'cf7_infusionsoft_admin_notice' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7-infusionsoft-add-on/cf7-infusionsoft-addon.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = cf7_infusionsoft_admin_notice(); 
  7.  

Defined (1)

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

/cf7-infusionsoft-addon.php  
  1. function cf7_infusionsoft_admin_notice() { 
  2. // Verify that CF7 is active and updated to the required version (currently 3.9.0) 
  3. if ( is_plugin_active('contact-form-7/wp-contact-form-7.php') ) { 
  4. $wpcf7_path = plugin_dir_path( dirname(__FILE__) ) . 'contact-form-7/wp-contact-form-7.php'; 
  5. $wpcf7_plugin_data = get_plugin_data( $wpcf7_path, false, false); 
  6. $wpcf7_version = (int)preg_replace('/[.]/', '', $wpcf7_plugin_data['Version']); 
  7. // CF7 drops the ending ".0" for new major releases (e.g. Version 4.0 instead of 4.0.0...which would make the above version "40") 
  8. // We need to make sure this value has a digit in the 100s place. 
  9. if ( $wpcf7_version < 100 ) { 
  10. $wpcf7_version = $wpcf7_version * 10; 
  11. // If CF7 version is < 3.9.0 
  12. if ( $wpcf7_version < 390 ) { 
  13. echo '<div class="update-nag"><p><strong>Warning: </strong>Contact Form 7 - InfusionSoft Add-on requires that you have the latest version of Contact Form 7 installed. Please upgrade now.</p></div>'; 
  14. // If it's not installed and activated, throw an error 
  15. else { 
  16. echo '<div class="error"><p>Contact Form 7 is not activated. Contact Form 7 must be installed and activated before you can use the InfusionSoft Add-on.</p></div>';