Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/google-site-kit/includes/Core/Prompts/Prompts.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 + /**
3 + * Class Google\Site_Kit\Core\Prompts\Prompts
4 + *
5 + * @package Google\Site_Kit\Core\Prompts
6 + * @copyright 2024 Google LLC
7 + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
8 + * @link https://sitekit.withgoogle.com
9 + */
10 +
11 + namespace Google\Site_Kit\Core\Prompts;
12 +
13 + use Google\Site_Kit\Context;
14 + use Google\Site_Kit\Core\Storage\User_Options;
15 +
16 + /**
17 + * Class for handling prompts.
18 + *
19 + * @since 1.121.0
20 + * @access private
21 + * @ignore
22 + */
23 + class Prompts {
24 +
25 + /**
26 + * Dismissed_Prompts instance.
27 + *
28 + * @since 1.121.0
29 + * @var Dismissed_Prompts
30 + */
31 + protected $dismissed_prompts;
32 +
33 + /**
34 + * REST_Prompts_Controller instance.
35 + *
36 + * @since 1.121.0
37 + * @var REST_Prompts_Controller
38 + */
39 + protected $rest_controller;
40 +
41 + /**
42 + * Constructor.
43 + *
44 + * @since 1.121.0
45 + *
46 + * @param Context $context Plugin context.
47 + * @param User_Options $user_options Optional. User option API. Default is a new instance.
48 + */
49 + public function __construct( Context $context, ?User_Options $user_options = null ) {
50 + $this->dismissed_prompts = new Dismissed_Prompts( $user_options ?: new User_Options( $context ) );
51 + $this->rest_controller = new REST_Prompts_Controller( $this->dismissed_prompts );
52 + }
53 +
54 + /**
55 + * Gets the reference to the Dismissed_Prompts instance.
56 + *
57 + * @since 1.121.0
58 + *
59 + * @return Dismissed_Prompts An instance of the Dismissed_Prompts class.
60 + */
61 + public function get_dismissed_prompts() {
62 + return $this->dismissed_prompts;
63 + }
64 +
65 + /**
66 + * Registers functionality through WordPress hooks.
67 + *
68 + * @since 1.121.0
69 + */
70 + public function register() {
71 + $this->dismissed_prompts->register();
72 + $this->rest_controller->register();
73 + }
74 + }
75 +