✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.138
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/woocommerce/src/Internal/Admin//Coupons.php
<?php
/**
 * WooCommerce Marketing > Coupons.
 */

namespace Automattic\WooCommerce\Internal\Admin;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\PageController;

/**
 * Contains backend logic for the Coupons feature.
 */
class Coupons {

	use CouponsMovedTrait;

	/**
	 * Class instance.
	 *
	 * @var Coupons instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		if ( ! is_admin() ) {
			return;
		}

		// If the main marketing feature is disabled, don't modify coupon behavior.
		if ( ! Features::is_enabled( 'marketing' ) ) {
			return;
		}

		// Only support coupon modifications if coupons are enabled.
		if ( ! wc_coupons_enabled() ) {
			return;
		}

		add_action( 'admin_enqueue_scripts', array( $this, 'maybe_add_marketing_coupon_script' ) );
		add_action( 'woocommerce_register_post_type_shop_coupon', array( $this, 'move_coupons' ) );
		add_action( 'admin_head', array( $this, 'fix_coupon_menu_highlight' ), 99 );
		add_action( 'admin_menu', array( $this, 'maybe_add_coupon_menu_redirect' ) );
	}

	/**
	 * Maybe add menu item back in original spot to help people transition
	 */
	public function maybe_add_coupon_menu_redirect() {
		if ( ! $this->should_display_legacy_menu() ) {
			return;
		}

		add_submenu_page(
			'woocommerce',
			__( 'Coupons', 'woocommerce' ),
			__( 'Coupons', 'woocommerce' ),
			'manage_options',
			'coupons-moved',
			array( $this, 'coupon_menu_moved' )
		);
	}

	/**
	 * Call back for transition menu item
	 */
	public function coupon_menu_moved() {
		wp_safe_redirect( $this->get_legacy_coupon_url(), 301 );
		exit();
	}

	/**
	 * Modify registered post type shop_coupon
	 *
	 * @param array $args Array of post type parameters.
	 *
	 * @return array the filtered parameters.
	 */
	public function move_coupons( $args ) {
		$args['show_in_menu'] = current_user_can( 'manage_woocommerce' ) ? 'woocommerce-marketing' : true;
		return $args;
	}

	/**
	 * Undo WC modifications to $parent_file for 'shop_coupon'
	 */
	public function fix_coupon_menu_highlight() {
		global $parent_file, $post_type;

		if ( $post_type === 'shop_coupon' ) {
			$parent_file = 'woocommerce-marketing'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride
		}
	}

	/**
	 * Maybe add our wc-admin coupon scripts if viewing coupon pages
	 */
	public function maybe_add_marketing_coupon_script() {
		$curent_screen = PageController::get_instance()->get_current_page();
		if ( ! isset( $curent_screen['id'] ) || $curent_screen['id'] !== 'woocommerce-coupons' ) {
			return;
		}

		WCAdminAssets::register_style( 'marketing-coupons', 'style' );
		WCAdminAssets::register_script( 'wp-admin-scripts', 'marketing-coupons', true );
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Agentic
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
BlockTemplates
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
EmailImprovements
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
EmailPreview
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Emails
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ImportExport
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Logging
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Marketing
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Notes
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Onboarding
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Orders
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ProductForm
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ProductReviews
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
RemoteFreeExtensions
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Schedulers
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Settings
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Suggestions
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
WCPayPromotion
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ActivityPanels.php
1.578 KB
24 Aug 2022 2.07 AM
tdhomesa / tdhomesa
0644
Analytics.php
11.784 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
CategoryLookup.php
7.988 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
Coupons.php
2.859 KB
14 Nov 2024 1.17 AM
tdhomesa / tdhomesa
0644
CouponsMovedTrait.php
2.412 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
CustomerEffortScoreTracks.php
17.652 KB
24 Nov 2025 11.10 PM
tdhomesa / tdhomesa
0644
Events.php
8.538 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
FeaturePlugin.php
6.766 KB
23 Feb 2026 5.58 PM
tdhomesa / tdhomesa
0644
Homescreen.php
8.697 KB
11 May 2026 5.17 PM
tdhomesa / tdhomesa
0644
Loader.php
19.183 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
Marketing.php
6.289 KB
14 Nov 2024 1.17 AM
tdhomesa / tdhomesa
0644
Marketplace.php
3.478 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
MobileAppBanner.php
0.934 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
RemoteInboxNotifications.php
0.91 KB
21 Mar 2023 8.45 PM
tdhomesa / tdhomesa
0644
Settings.php
14.613 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
ShippingLabelBanner.php
4.667 KB
23 Sep 2024 8.44 PM
tdhomesa / tdhomesa
0644
ShippingLabelBannerDisplayRules.php
3.631 KB
4 Sep 2024 8.34 PM
tdhomesa / tdhomesa
0644
SiteHealth.php
2.314 KB
22 Feb 2023 7.17 AM
tdhomesa / tdhomesa
0644
Survey.php
0.75 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
SystemStatusReport.php
5.85 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
Translations.php
11.662 KB
14 Nov 2024 1.17 AM
tdhomesa / tdhomesa
0644
WCAdminAssets.php
17.744 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
WCAdminSharedSettings.php
2.078 KB
22 Apr 2025 3.40 PM
tdhomesa / tdhomesa
0644
WCAdminUser.php
5.264 KB
6 Oct 2025 5.56 PM
tdhomesa / tdhomesa
0644
WcPayWelcomePage.php
6.329 KB
23 Jun 2025 7.46 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF