# yaymail/2.1.5/includes/Page/Source/UpdateElement.php

YayMail – WooCommerce Email Customizer, version 2.1.5. 35 lines.

- Page: https://pluginprobe.com/plugins/yaymail/2.1.5/code/includes/Page/Source/UpdateElement.php
- Raw: https://pluginprobe.com/plugins/yaymail/2.1.5/raw/includes/Page/Source/UpdateElement.php
- Modified: 2021-08-04T20:29:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yaymail/2.1.5/code/includes/Page/Source/UpdateElement.php#L10-L20`.

```php
<?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 ) {
		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;
	}
}

```
