ninja_forms_three_addons_check
The Ninja Forms ninja forms three addons check function.
Description
ninja_forms_three_addons_check();
Usage
if ( !function_exists( 'ninja_forms_three_addons_check' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/ninja-forms.php'; } // NOTICE! Understand what this does before running. $result = ninja_forms_three_addons_check();
Defined (1)
The function is defined in the following location(s).
- /deprecated/ninja-forms.php
- function ninja_forms_three_addons_check() {
- $items = file_get_contents( dirname( __FILE__ ) . '/addons-feed.json' );
- $items = json_decode($items, true);
- $has_addons = FALSE;
- if( is_array( $items ) ) {
- foreach ($items as $item) {
- if (empty($item['plugin'])) continue;
- if (!file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) continue;
- $has_addons = TRUE;
- $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $item['plugin'], false, true);
- if (!$plugin_data['Version']) continue;
- if (version_compare($plugin_data['Version'], '3', '>=')) continue;
- /**
- * There are non-compatible add-ons installed.
- */
- return FALSE;
- }
- }
- return $has_addons;
- }