/var/www/html_us/wp-content/plugins/yaymail/includes/Page/Source/UpdateElement.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace YayMail\Page\Source;

defined'ABSPATH' ) || exit;

class 
UpdateElement {

    public 
$updateElements null;

    public function 
__construct() {
        
$this->updateElements = array();

        
//Filter to add new updated Element's properties
        
add_filter(
            
'yaymail_addon_get_updated_elements',
            function( 
$element ) {
                
$result array_merge(
                    
$element,
                    array()
                );
                return 
$result;
            }
        );
        
$this->updateElements apply_filters'yaymail_addon_get_updated_elements'$this->updateElements );
    }
    public function 
merge_new_props_to_elements$yaymail_elements ) {
        if ( 
is_array$yaymail_elements ) || is_object$yaymail_elements ) ) {
            foreach ( 
$yaymail_elements as $key => $element ) {
                if ( isset( 
$this->updateElements$element['type'] ] ) ) {
                    
$yaymail_elements$key ]['settingRow'] = wp_parse_args$yaymail_elements$key ]['settingRow'], $this->updateElements$element['type'] ] );
                }
            }
        }
        return 
$yaymail_elements;
    }
}