File "ShouldDisplayShippingMethodInstanceSettings.php"
Full Path: /home/jlklyejr/public_html/wp-content/test/wp-content/plugins/flexible-shipping/vendor_prefixed/octolize/wp-octolize-tracker/src/OptInNotice/ShouldDisplayShippingMethodInstanceSettings.php
File size: 803 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
namespace FSVendor\Octolize\Tracker\OptInNotice;
/**
* Should display shipping method settings page.
*/
class ShouldDisplayShippingMethodInstanceSettings implements \FSVendor\Octolize\Tracker\OptInNotice\ShouldDisplay
{
/**
* @var string
*/
private $shipping_method_id;
/**
* @param string $shipping_method_id
*/
public function __construct(string $shipping_method_id)
{
$this->shipping_method_id = $shipping_method_id;
}
/**
* @inheritDoc
*/
public function should_display()
{
$shipping_method = \WC_Shipping_Zones::get_shipping_method($_GET['instance_id'] ?? 0);
return $shipping_method && $shipping_method instanceof \WC_Shipping_Method && $shipping_method->id === $this->shipping_method_id;
}
}