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

YayMail – WooCommerce Email Customizer, version 3.3. 37 lines.

- Page: https://pluginprobe.com/plugins/yaymail/3.3/code/includes/Page/Source/UpdateElement.php
- Raw: https://pluginprobe.com/plugins/yaymail/3.3/raw/includes/Page/Source/UpdateElement.php
- Modified: 2023-08-01T09:04:54+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/3.3/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 ) {
		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;
	}
}

```
