PluginProbe
Polylang / 3.7
Polylang v3.7
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / include / Options / Business / First_Activation.php

First_Activation.php in Polylang 3.7, at include/Options/Business/First_Activation.php

73 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Polylang
4 */
5
6 namespace WP_Syntex\Polylang\Options\Business;
7
8 use WP_Syntex\Polylang\Options\Abstract_Option;
9
10 defined( 'ABSPATH' ) || exit;
11
12 /**
13 * Class defining the first activation option.
14 *
15 * @since 3.7
16 */
17 class First_Activation extends Abstract_Option {
18 /**
19 * Returns option key.
20 *
21 * @since 3.7
22 *
23 * @return string
24 *
25 * @phpstan-return 'first_activation'
26 */
27 public static function key(): string {
28 return 'first_activation';
29 }
30
31 /**
32 * Returns the default value.
33 *
34 * @since 3.7
35 *
36 * @return int
37 *
38 * @phpstan-return int<0, max>
39 */
40 protected function get_default() {
41 return time();
42 }
43
44 /**
45 * Returns the JSON schema part specific to this option.
46 *
47 * @since 3.7
48 *
49 * @return array Partial schema.
50 *
51 * @phpstan-return array{type: 'integer', minimum: 0, maximum: int<0, max>, readonly: true}
52 */
53 protected function get_data_structure(): array {
54 return array(
55 'type' => 'integer',
56 'minimum' => 0,
57 'maximum' => PHP_INT_MAX,
58 'readonly' => true,
59 );
60 }
61
62 /**
63 * Returns the description used in the JSON schema.
64 *
65 * @since 3.7
66 *
67 * @return string
68 */
69 protected function get_description(): string {
70 return __( 'Time of first activation of Polylang.', 'polylang' );
71 }
72 }
73