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 / Abstracts / BaseShortcode.php

BaseShortcode.php in YayMail – WooCommerce Email Customizer trunk, at src/Abstracts/BaseShortcode.php

30 lines 735 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace YayMail\Abstracts;
3
4 /**
5 * BaseShortcode Class
6 */
7 abstract class BaseShortcode {
8
9 public $available_email_ids = [ YAYMAIL_WITH_ORDER_EMAILS ];
10
11 /**
12 * Define list of shortcodes
13 *
14 * Shortcode structure: name, description, group, callback
15 *
16 * @return array list shortcodes
17 */
18 abstract public function get_shortcodes();
19
20 protected function __construct() {
21 foreach ( $this->available_email_ids as $email_id ) {
22 add_action( 'yaymail_' . $email_id . '_register_shortcodes', [ $this, 'add_shortcodes_to_email' ] );
23 }
24 }
25
26 public function add_shortcodes_to_email( $email ) {
27 $email->register_shortcodes( $this->get_shortcodes() );
28 }
29 }
30