PluginProbe
YayMail – WooCommerce Email Customizer / trunk
YayMail – WooCommerce Email Customizer vtrunk
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 3.4.2 3.4.3 All 55 releases
yaymail / src / Platform / YaymailPlatform.php

YaymailPlatform.php in YayMail – WooCommerce Email Customizer trunk, at src/Platform/YaymailPlatform.php

51 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 * WooCommerce platform implementation (the "yaymail" product).
4 *
5 * @package YayMail\Platform
6 */
7
8 namespace YayMail\Platform;
9
10 defined( 'ABSPATH' ) || exit;
11
12 class YaymailPlatform implements PlatformInterface {
13
14 public function key(): string {
15 return 'yaymail';
16 }
17
18 public function plugin_path(): string {
19 return YAYMAIL_PLUGIN_PATH;
20 }
21
22 public function plugin_url(): string {
23 return YAYMAIL_PLUGIN_URL;
24 }
25
26 public function hook_suffix(): string {
27 $prefix = defined( 'YAYMAIL_PREFIX' ) ? YAYMAIL_PREFIX : 'yaymail';
28 return 'yaycommerce_page_' . $prefix . '-settings';
29 }
30
31 public function attachment_option_name(): string {
32 return YAYMAIL_ATTACHMENT_OPTION_NAME;
33 }
34
35 public function ghf_option_key( string $variant = 'base' ): string {
36 return 'enabled' === $variant ? 'global_header_footer_enabled' : 'yaymail_global_header_footer';
37 }
38
39 public function adapter() {
40 return class_exists( 'YaymailPluginAdapter', false ) ? new \YaymailPluginAdapter() : null;
41 }
42
43 public function is_woo_product(): bool {
44 return true;
45 }
46
47 public function woo_available(): bool {
48 return class_exists( 'WooCommerce' );
49 }
50 }
51