PluginProbe
Parse.ly / 3.24.2
Parse.ly v3.24.2
3.24.3 3.24.2 3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 All 107 releases
wp-parsely / src / rest-api / settings / class-endpoint-dashboard-widget-settings.php

class-endpoint-dashboard-widget-settings.php in Parse.ly 3.24.2, at src/rest-api/settings/class-endpoint-dashboard-widget-settings.php

66 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * API Endpoint: Dashboard Widget Settings
4 *
5 * @package Parsely
6 * @since 3.17.0
7 */
8
9 declare(strict_types=1);
10
11 namespace Parsely\REST_API\Settings;
12
13 /**
14 * Endpoint for saving and retrieving Content Intelligence Dashboard Widget
15 * settings.
16 *
17 * @since 3.17.0
18 *
19 * @phpstan-import-type Subvalue_Spec from Base_Settings_Endpoint
20 */
21 class Endpoint_Dashboard_Widget_Settings extends Base_Settings_Endpoint {
22 /**
23 * Returns the endpoint's name.
24 *
25 * @since 3.17.0
26 *
27 * @return string
28 */
29 public static function get_endpoint_name(): string {
30 return 'dashboard-widget';
31 }
32
33 /**
34 * Returns the meta entry's key.
35 *
36 * @since 3.13.0
37 * @since 3.17.0 Moved from Dashboard_Widget_Settings_Endpoint.
38 *
39 * @return string The meta entry's key.
40 */
41 protected function get_meta_key(): string {
42 return 'parsely_content_helper_settings_dashboard_widget';
43 }
44
45 /**
46 * Returns the endpoint's subvalues specifications.
47 *
48 * @since 3.13.0
49 * @since 3.17.0 Moved from Dashboard_Widget_Settings_Endpoint.
50 *
51 * @return array<string, Subvalue_Spec>
52 */
53 protected function get_subvalues_specs(): array {
54 return array(
55 'Metric' => array(
56 'values' => array( 'views', 'avg_engaged' ),
57 'default' => 'views',
58 ),
59 'Period' => array(
60 'values' => array( '10m', '1h', '2h', '4h', '24h', '7d', '30d' ),
61 'default' => '7d',
62 ),
63 );
64 }
65 }
66