Make sure woocommece-services is an allowed plugin on for shipping prompt. (https://github.com/woocommerce/woocommerce-admin/pull/4233)
This commit is contained in:
parent
612790227c
commit
8fa6180dee
|
@ -26,12 +26,28 @@ class ShippingLabelBanner {
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
add_filter( 'woocommerce_admin_plugins_whitelist', array( $this, 'get_shipping_banner_allowed_plugins' ), 10, 2 );
|
||||||
|
|
||||||
if ( ! is_admin() ) {
|
if ( ! is_admin() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 6, 2 );
|
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 6, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets an array of plugins that can be installed & activated via shipping label prompt.
|
||||||
|
*
|
||||||
|
* @param array $plugins Array of plugin slugs to be allowed.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function get_shipping_banner_allowed_plugins( $plugins ) {
|
||||||
|
$shipping_banner_plugins = array(
|
||||||
|
'woocommerce-services' => 'woocommerce-services/woocommerce-services.php',
|
||||||
|
);
|
||||||
|
return array_merge( $plugins, $shipping_banner_plugins );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if WooCommerce Shipping makes sense for this merchant.
|
* Check if WooCommerce Shipping makes sense for this merchant.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue