PluginProbe
Parse.ly / 3.24.2
Parse.ly v3.24.2
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 3.20.2 All 106 releases
wp-parsely / src / rest-api / settings / class-endpoint-headline-testing-settings.php

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

81 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Headline Testing Settings Endpoint
4 *
5 * @package Parsely
6 * @since 3.21.0
7 */
8
9 declare(strict_types=1);
10
11 namespace Parsely\REST_API\Settings;
12
13 use Parsely\REST_API\Settings\Base_Settings_Endpoint;
14
15 /**
16 * Endpoint for managing Headline Testing settings.
17 *
18 * @since 3.21.0
19 *
20 * @phpstan-import-type Subvalue_Spec from Base_Settings_Endpoint
21 */
22 class Endpoint_Headline_Testing_Settings extends Base_Settings_Endpoint {
23 /**
24 * Returns the endpoint's name.
25 *
26 * @since 3.21.0
27 *
28 * @return string
29 */
30 public static function get_endpoint_name(): string {
31 return 'headline-testing';
32 }
33
34 /**
35 * Returns the meta entry's key.
36 *
37 * @since 3.21.0
38 *
39 * @return string The meta entry's key.
40 */
41 protected function get_meta_key(): string {
42 return 'headline_testing';
43 }
44
45 /**
46 * Returns the endpoint's subvalues specifications.
47 *
48 * @since 3.21.0
49 *
50 * @return array<string, Subvalue_Spec>
51 */
52 protected function get_subvalues_specs(): array {
53 return array(
54 'enabled' => array(
55 'values' => array( true, false ),
56 'default' => false,
57 ),
58 'installation_method' => array(
59 'values' => array( 'one_line', 'advanced' ),
60 'default' => 'one_line',
61 ),
62 'enable_flicker_control' => array(
63 'values' => array( true, false ),
64 'default' => false,
65 ),
66 'enable_live_updates' => array(
67 'values' => array( true, false ),
68 'default' => false,
69 ),
70 'live_update_timeout' => array(
71 'values' => range( 1000, 60000, 1000 ),
72 'default' => 30000,
73 ),
74 'allow_after_content_load' => array(
75 'values' => array( true, false ),
76 'default' => false,
77 ),
78 );
79 }
80 }
81