Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-content
/
test
/
wp-content
/
plugins
/
flexible-shipping
/
vendor_prefixed
/
octolize
/
wp-octolize-tracker
/
src
/
OptInNotice
:
ShouldDisplayShippingMethodInstanceSettings.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?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; } }