PluginProbe
YayMail – WooCommerce Email Customizer / 3.4
YayMail – WooCommerce Email Customizer v3.4
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 / includes / Page / Source / UpdateElement.php

UpdateElement.php in YayMail – WooCommerce Email Customizer 3.4, at includes/Page/Source/UpdateElement.php

37 lines 983 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace YayMail\Page\Source;
3
4 defined( 'ABSPATH' ) || exit;
5
6 class UpdateElement {
7
8 public $updateElements = null;
9
10 public function __construct() {
11 $this->updateElements = array();
12
13 //Filter to add new updated Element's properties
14 add_filter(
15 'yaymail_addon_get_updated_elements',
16 function( $element ) {
17 $result = array_merge(
18 $element,
19 array()
20 );
21 return $result;
22 }
23 );
24 $this->updateElements = apply_filters( 'yaymail_addon_get_updated_elements', $this->updateElements );
25 }
26 public function merge_new_props_to_elements( $yaymail_elements ) {
27 if ( is_array( $yaymail_elements ) || is_object( $yaymail_elements ) ) {
28 foreach ( $yaymail_elements as $key => $element ) {
29 if ( isset( $this->updateElements[ $element['type'] ] ) ) {
30 $yaymail_elements[ $key ]['settingRow'] = wp_parse_args( $yaymail_elements[ $key ]['settingRow'], $this->updateElements[ $element['type'] ] );
31 }
32 }
33 }
34 return $yaymail_elements;
35 }
36 }
37