PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / integrations / alerts / abstract-dismissable-alert.php

abstract-dismissable-alert.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at src/integrations/alerts/abstract-dismissable-alert.php

46 lines 933 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Integrations\Alerts;
4
5 use Yoast\WP\SEO\Integrations\Integration_Interface;
6
7 /**
8 * Dismissable_Alert class.
9 */
10 abstract class Abstract_Dismissable_Alert implements Integration_Interface {
11
12 /**
13 * Holds the alert identifier.
14 *
15 * @var string
16 */
17 protected $alert_identifier;
18
19 /**
20 * {@inheritDoc}
21 */
22 public static function get_conditionals() {
23 return [];
24 }
25
26 /**
27 * {@inheritDoc}
28 */
29 public function register_hooks() {
30 \add_filter( 'wpseo_allowed_dismissable_alerts', [ $this, 'register_dismissable_alert' ] );
31 }
32
33 /**
34 * Registers the dismissable alert.
35 *
36 * @param string[] $allowed_dismissable_alerts The allowed dismissable alerts.
37 *
38 * @return string[] The allowed dismissable alerts.
39 */
40 public function register_dismissable_alert( $allowed_dismissable_alerts ) {
41 $allowed_dismissable_alerts[] = $this->alert_identifier;
42
43 return $allowed_dismissable_alerts;
44 }
45 }
46