# wordpress-seo/trunk/src/integrations/alerts/abstract-dismissable-alert.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version trunk. 46 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/trunk/code/src/integrations/alerts/abstract-dismissable-alert.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/trunk/raw/src/integrations/alerts/abstract-dismissable-alert.php
- Modified: 2021-02-04T15:03:42+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/wordpress-seo/trunk/code/src/integrations/alerts/abstract-dismissable-alert.php#L10-L20`.

```php
<?php

namespace Yoast\WP\SEO\Integrations\Alerts;

use Yoast\WP\SEO\Integrations\Integration_Interface;

/**
 * Dismissable_Alert class.
 */
abstract class Abstract_Dismissable_Alert implements Integration_Interface {

	/**
	 * Holds the alert identifier.
	 *
	 * @var string
	 */
	protected $alert_identifier;

	/**
	 * {@inheritDoc}
	 */
	public static function get_conditionals() {
		return [];
	}

	/**
	 * {@inheritDoc}
	 */
	public function register_hooks() {
		\add_filter( 'wpseo_allowed_dismissable_alerts', [ $this, 'register_dismissable_alert' ] );
	}

	/**
	 * Registers the dismissable alert.
	 *
	 * @param string[] $allowed_dismissable_alerts The allowed dismissable alerts.
	 *
	 * @return string[] The allowed dismissable alerts.
	 */
	public function register_dismissable_alert( $allowed_dismissable_alerts ) {
		$allowed_dismissable_alerts[] = $this->alert_identifier;

		return $allowed_dismissable_alerts;
	}
}

```
