mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +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 - DCC orders randomly failing #503
|
||||||
* Fix - Multi-currency broke #481
|
* Fix - Multi-currency broke #481
|
||||||
* Fix - Address information from PayPal shortcut flow not loaded #451
|
* 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 - Improve onboarding flow, allow no card processing #443
|
||||||
* Enhancement - Add Germany to supported ACDC countries #459
|
* Enhancement - Add Germany to supported ACDC countries #459
|
||||||
* Enhancement - Add filters to allow ACDC for countries #437
|
* 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 - DCC orders randomly failing #503
|
||||||
* Fix - Multi-currency broke #481
|
* Fix - Multi-currency broke #481
|
||||||
* Fix - Address information from PayPal shortcut flow not loaded #451
|
* 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 - Improve onboarding flow, allow no card processing #443
|
||||||
* Enhancement - Add Germany to supported ACDC countries #459
|
* Enhancement - Add Germany to supported ACDC countries #459
|
||||||
* Enhancement - Add filters to allow ACDC for countries #437
|
* Enhancement - Add filters to allow ACDC for countries #437
|
||||||
|
|
|
@ -41,10 +41,7 @@ define( 'PPCP_FLAG_SUBSCRIPTION', true );
|
||||||
function init() {
|
function init() {
|
||||||
$root_dir = __DIR__;
|
$root_dir = __DIR__;
|
||||||
|
|
||||||
if ( ! function_exists( 'is_plugin_active' ) ) {
|
if ( ! is_woocommerce_activated() ) {
|
||||||
require_once ABSPATH . '/wp-admin/includes/plugin.php';
|
|
||||||
}
|
|
||||||
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
|
||||||
add_action(
|
add_action(
|
||||||
'admin_notices',
|
'admin_notices',
|
||||||
function() {
|
function() {
|
||||||
|
@ -124,10 +121,7 @@ define( 'PPCP_FLAG_SUBSCRIPTION', true );
|
||||||
add_filter(
|
add_filter(
|
||||||
'plugin_action_links_' . plugin_basename( __FILE__ ),
|
'plugin_action_links_' . plugin_basename( __FILE__ ),
|
||||||
function( $links ) {
|
function( $links ) {
|
||||||
if ( ! function_exists( 'is_plugin_active' ) ) {
|
if ( ! is_woocommerce_activated() ) {
|
||||||
require_once ABSPATH . '/wp-admin/includes/plugin.php';
|
|
||||||
}
|
|
||||||
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
|
||||||
return $links;
|
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