PluginProbe
Polylang / 3.8.7
Polylang v3.8.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 / src / Options / Primitive / Abstract_String.php

Abstract_String.php in Polylang 3.8.7, at src/Options/Primitive/Abstract_String.php

58 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\Primitive;
7
8 use WP_Syntex\Polylang\Options\Abstract_Option;
9 use WP_Syntex\Polylang\Options\Options;
10
11 defined( 'ABSPATH' ) || exit;
12
13 /**
14 * Class defining single string option.
15 *
16 * @since 3.7
17 */
18 abstract class Abstract_String extends Abstract_Option {
19 /**
20 * Returns the default value.
21 *
22 * @since 3.7
23 *
24 * @return string
25 */
26 protected function get_default() {
27 return '';
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: 'string'}
38 */
39 protected function get_data_structure(): array {
40 return array(
41 'type' => 'string',
42 );
43 }
44
45 /**
46 * Adds information to the site health info array.
47 *
48 * @since 3.8
49 *
50 * @param Options $options An instance of the Options class providing additional configuration.
51 *
52 * @return array The updated site health information.
53 */
54 public function get_site_health_info( Options $options ): array { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
55 return $this->format_single_value_for_site_health_info( $this->get() );
56 }
57 }
58