PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.0
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.0
28.6 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 All 130 releases
wordpress-seo / src / schema-aggregator / application / schema-aggregator-announcement.php

schema-aggregator-announcement.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.0, at src/schema-aggregator/application/schema-aggregator-announcement.php

62 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3 namespace Yoast\WP\SEO\Schema_Aggregator\Application;
4
5 use Yoast\WP\SEO\Helpers\Current_Page_Helper;
6 use Yoast\WP\SEO\Introductions\Application\User_Allowed_Trait;
7 use Yoast\WP\SEO\Introductions\Domain\Introduction_Interface;
8
9 /**
10 * Represents the introduction for the Schema aggregator feature announcement.
11 */
12 class Schema_Aggregator_Announcement implements Introduction_Interface {
13
14 use User_Allowed_Trait;
15
16 public const ID = 'schema-aggregator-announcement';
17
18 /**
19 * Holds the current page helper.
20 *
21 * @var Current_Page_Helper
22 */
23 private $current_page_helper;
24
25 /**
26 * Constructs the introduction.
27 *
28 * @param Current_Page_Helper $current_page_helper The current page helper.
29 */
30 public function __construct( Current_Page_Helper $current_page_helper ) {
31 $this->current_page_helper = $current_page_helper;
32 }
33
34 /**
35 * Returns the ID.
36 *
37 * @return string The ID.
38 */
39 public function get_id() {
40 return self::ID;
41 }
42
43 /**
44 * Returns the requested pagination priority. Lower means earlier.
45 *
46 * @return int The priority.
47 */
48 public function get_priority() {
49 return 20;
50 }
51
52 /**
53 * Returns whether this introduction should show.
54 *
55 * @return bool Whether this introduction should show.
56 */
57 public function should_show() {
58 return $this->current_page_helper->is_yoast_seo_page()
59 && $this->is_user_allowed( [ 'wpseo_manage_options' ] );
60 }
61 }
62