mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge pull request #498 from woocommerce/PCP-524-check-if-woocommerce-is-active-mu-plugins
Change the way of checking if WooCommerce is active
This commit is contained in:
commit
2cb0efb10a
3 changed files with 13 additions and 8 deletions
|
@ -4,6 +4,7 @@
|
|||
* Fix - DCC orders randomly failing #503
|
||||
* Fix - Multi-currency broke #481
|
||||
* Fix - Address information from PayPal shortcut flow not loaded #451
|
||||
* Fix - WooCommerce as mu-plugin is not detected as active #461
|
||||
* Enhancement - Improve onboarding flow, allow no card processing #443
|
||||
* Enhancement - Add Germany to supported ACDC countries #459
|
||||
* Enhancement - Add filters to allow ACDC for countries #437
|
||||
|
|
|
@ -85,6 +85,7 @@ Follow the steps below to connect the plugin to your PayPal account:
|
|||
* Fix - DCC orders randomly failing #503
|
||||
* Fix - Multi-currency broke #481
|
||||
* Fix - Address information from PayPal shortcut flow not loaded #451
|
||||
* Fix - WooCommerce as mu-plugin is not detected as active #461
|
||||
* Enhancement - Improve onboarding flow, allow no card processing #443
|
||||
* Enhancement - Add Germany to supported ACDC countries #459
|
||||
* Enhancement - Add filters to allow ACDC for countries #437
|
||||
|
|
|
@ -41,10 +41,7 @@ define( 'PPCP_FLAG_SUBSCRIPTION', true );
|
|||
function init() {
|
||||
$root_dir = __DIR__;
|
||||
|
||||
if ( ! function_exists( 'is_plugin_active' ) ) {
|
||||
require_once ABSPATH . '/wp-admin/includes/plugin.php';
|
||||
}
|
||||
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
if ( ! is_woocommerce_activated() ) {
|
||||
add_action(
|
||||
'admin_notices',
|
||||
function() {
|
||||
|
@ -124,10 +121,7 @@ define( 'PPCP_FLAG_SUBSCRIPTION', true );
|
|||
add_filter(
|
||||
'plugin_action_links_' . plugin_basename( __FILE__ ),
|
||||
function( $links ) {
|
||||
if ( ! function_exists( 'is_plugin_active' ) ) {
|
||||
require_once ABSPATH . '/wp-admin/includes/plugin.php';
|
||||
}
|
||||
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
if ( ! is_woocommerce_activated() ) {
|
||||
return $links;
|
||||
}
|
||||
|
||||
|
@ -144,4 +138,13 @@ define( 'PPCP_FLAG_SUBSCRIPTION', true );
|
|||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Check if WooCommerce is active.
|
||||
*
|
||||
* @return bool true if WooCommerce is active, otherwise false.
|
||||
*/
|
||||
function is_woocommerce_activated(): bool {
|
||||
return class_exists( 'woocommerce' );
|
||||
}
|
||||
|
||||
} )();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue