Do not initialize WC Pay promotion if spec is empty (https://github.com/woocommerce/woocommerce-admin/pull/8087)
This commit is contained in:
parent
61cdae82c4
commit
ccd2495ff4
|
@ -24,7 +24,10 @@ class WCPaymentGatewayPreInstallWCPayPromotion extends \WC_Payment_Gateway {
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$wc_pay_spec = Init::get_wc_pay_promotion_spec();
|
$wc_pay_spec = Init::get_wc_pay_promotion_spec();
|
||||||
|
if ( ! $wc_pay_spec ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->id = static::GATEWAY_ID;
|
$this->id = static::GATEWAY_ID;
|
||||||
$this->method_title = $wc_pay_spec->title;
|
$this->method_title = $wc_pay_spec->title;
|
||||||
if ( property_exists( $wc_pay_spec, 'sub_title' ) ) {
|
if ( property_exists( $wc_pay_spec, 'sub_title' ) ) {
|
||||||
|
|
Loading…
Reference in New Issue