ninja_forms_three_addons_check

The Ninja Forms ninja forms three addons check function.

Description

ninja_forms_three_addons_check(); 

Usage

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

Defined (1)

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

/deprecated/ninja-forms.php  
  1. function ninja_forms_three_addons_check() { 
  2. $items = file_get_contents( dirname( __FILE__ ) . '/addons-feed.json' ); 
  3. $items = json_decode($items, true); 
  4.  
  5. $has_addons = FALSE; 
  6. if( is_array( $items ) ) { 
  7. foreach ($items as $item) { 
  8. if (empty($item['plugin'])) continue; 
  9. if (!file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) continue; 
  10. $has_addons = TRUE; 
  11. $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $item['plugin'], false, true); 
  12. if (!$plugin_data['Version']) continue; 
  13. if (version_compare($plugin_data['Version'], '3', '>=')) continue; 
  14. /** 
  15. * There are non-compatible add-ons installed. 
  16. */ 
  17. return FALSE; 
  18. return $has_addons;