PluginProbe
YayMail – WooCommerce Email Customizer / 4.4.5
YayMail – WooCommerce Email Customizer v4.4.5
4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 All 57 releases
yaymail / vendor-prefixed / src / Pages / WooCommerceRequiredPage.php

WooCommerceRequiredPage.php in YayMail – WooCommerce Email Customizer 4.4.5, at vendor-prefixed/src/Pages/WooCommerceRequiredPage.php

31 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YayMailScoped\YayCommerce\AdminShell\Pages;
4
5 /**
6 * Renders the shared "WooCommerce required" full-screen gate.
7 *
8 * Installed as the settings-page callback by PluginSubmenu when a plugin opts in
9 * (adapter's optional needs_woocommerce_screen() returns true). Copy is
10 * de-branded by default; a plugin may override any field via the adapter's
11 * optional get_woocommerce_screen_copy() method.
12 */
13 class WooCommerceRequiredPage
14 {
15 /**
16 * @param array $copy Optional overrides: icon, title, text, button, hint.
17 */
18 public static function render(array $copy = []): void
19 {
20 $copy = array_merge(self::defaults(), array_filter($copy));
21 include __DIR__ . '/../../views/woocommerce-required-page.php';
22 }
23 /**
24 * Generic, de-branded default copy.
25 */
26 private static function defaults(): array
27 {
28 return ['icon' => '🛒', 'title' => __('WooCommerce is required', 'yaycommerce'), 'text' => __('This plugin extends WooCommerce, so it needs WooCommerce installed and activated. Install WooCommerce to get started.', 'yaycommerce'), 'button' => __('Install WooCommerce', 'yaycommerce'), 'hint' => __('Already installed it? Activate WooCommerce, then reload this page.', 'yaycommerce')];
29 }
30 }
31