PluginProbe
Polylang / 3.8.8
Polylang v3.8.8
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 / src / Options / Primitive / Abstract_Boolean.php

Abstract_Boolean.php in Polylang 3.8.8, at src/Options/Primitive/Abstract_Boolean.php

45 lines 762 B
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\Primitive;
7
8 use WP_Syntex\Polylang\Options\Abstract_Option;
9
10 defined( 'ABSPATH' ) || exit;
11
12 /**
13 * Class defining single boolean option.
14 * Note that for historic reason, boolean are stored as 0 or 1.
15 *
16 * @since 3.7
17 */
18 abstract class Abstract_Boolean extends Abstract_Option {
19 /**
20 * Returns the default value.
21 *
22 * @since 3.7
23 *
24 * @return bool
25 */
26 protected function get_default() {
27 return false;
28 }
29
30 /**
31 * Returns the JSON schema part specific to this option.
32 *
33 * @since 3.7
34 *
35 * @return array Partial schema.
36 *
37 * @phpstan-return array{type: 'boolean'}
38 */
39 protected function get_data_structure(): array {
40 return array(
41 'type' => 'boolean',
42 );
43 }
44 }
45