• Resolved Emil

    (@qu1em)


    Hi,

    Thank you for this awesome plugin! Would you mind making a small change to allow compatibility with Multisite? This way of checking if WC is activated doesn’t work with Multisite if WC is activated network wide:

    if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) )
    	return;

    I’ve been searching for the best way to check if a plugin is active network wide myself and I think this is the best solution:

    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) )
    	return;

    https://wordpress.org/plugins/woocommerce-advanced-free-shipping/

Viewing 1 replies (of 1 total)
  • Plugin Author Jeroen Sormani

    (@sormano)

    Hi Emil,

    Thanks for your request!

    Its already in the code for the next update 😉

    If you want, you can put the code below in the __construct() function of the main plugin file:

    if ( ! function_exists( 'is_plugin_active_for_network' ) )
    			require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    
    		// Check if WooCommerce is active
    		if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) :
    			if ( ! is_plugin_active_for_network( 'woocommerce/woocommerce.php' ) ) :
    				return;
    			endif;
    		endif;

    This is a double check for multi site and single site activations.

    Thanks again for your request and let me know if you have any other.

    Jeroen

Viewing 1 replies (of 1 total)

The topic ‘Add support for multisite’ is closed to new replies.