EDD check
-
Since this plugin relies on Easy Digital Downloads you should do a check on init and deactivate if it’s not available. Otherwise might cause white screen or errors.
I’m doing this in a few of my own EDD plugins. Try:
add_action( 'admin_init', array( $this, 'is_edd_activated' ) );
/** * Easy Digital Downloads * * @return void */ function is_edd_activated() { if ( !defined( 'EDD_VERSION' ) ) { $this_plugin = plugin_basename( __FILE__ ); if ( is_plugin_active( $this_plugin ) ) { deactivate_plugins( $this_plugin ); add_action( 'admin_notices', array( $this, 'edd_notice' ) ); } } } /** * Admin notice. * * @return string */ function edd_notice() { echo '<div class="updated"><p>' . sprintf( __( '%s requires Easy Digital Downloads! Please activate and/or download EDD first. This plugin has been deactivated.', $this->plugin_name ), $this->plugin_name ) . '</p></div>'; }
Putting the functions in there appropriate places.
https://www.ads-software.com/extend/plugins/appthemer-crowdfunding/
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘EDD check’ is closed to new replies.