# defender-security/3.1.0/src/traits/setting.php

Defender Security – Malware Scanner, Login Security &amp; Firewall, version 3.1.0. 33 lines.

- Page: https://pluginprobe.com/plugins/defender-security/3.1.0/code/src/traits/setting.php
- Raw: https://pluginprobe.com/plugins/defender-security/3.1.0/raw/src/traits/setting.php
- Modified: 2021-09-27T07:37:58+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/defender-security/3.1.0/code/src/traits/setting.php#L10-L20`.

```php
<?php

namespace WP_Defender\Traits;

trait Setting {

	/**
	 * Prepare notice message.
	 *
	 * @param array  $data Form request.
	 * @param bool   $old_data Model activate value.
	 * @param string $module_name
	 *
	 * @return string
	 */
	public function get_update_message( $data, $old_data, $module_name ) {
		$new_data = (bool) $data['enabled'];

		// If old data and new data is matched, then it is not activated or deactivated.
		if ( $old_data === $new_data ) {
			return __( 'Your settings have been updated.', 'wpdef' );
		}

		if ( $new_data ) {
			/* translators: %s: Module name. */
			return sprintf( __( '%s has been activated.', 'wpdef' ), $module_name );
		}

		/* translators: %s: Module name. */
		return sprintf( __( '%s has been deactivated.', 'wpdef' ), $module_name );
	}
}

```
