← All changes
|
jetpack_vendor/automattic/jetpack-stats/src/class-options.php
+10
-5
12.5.2
→
16.3-beta
View file →
| @@ -30,9 +30,9 @@ | ||
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Stats Get Options. |
| 33 | 33 | * |
| 34 | - * @return array. | |
| 34 | + * @return array | |
| 35 | 35 | */ |
| 36 | 36 | public static function get_options() { |
| 37 | 37 | // Make sure we only get options from the database once per connection. |
| 38 | 38 | if ( array() !== self::$options ) { |
| @@ -49,12 +49,12 @@ | ||
| 49 | 49 | return self::$options; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * Get Stats Option.. | |
| 53 | + * Get Stats Option. | |
| 54 | 54 | * |
| 55 | 55 | * @param string $option Option name. |
| 56 | - * @return mixed|null. | |
| 56 | + * @return mixed|null | |
| 57 | 57 | */ |
| 58 | 58 | public static function get_option( $option ) { |
| 59 | 59 | if ( 'blog_id' === $option ) { |
| 60 | 60 | return Jetpack_Options::get_option( 'id' ); |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | * Stats Set Option. |
| 74 | 74 | * |
| 75 | 75 | * @param string $option The option name. |
| 76 | 76 | * @param mixed $value The option Value. |
| 77 | - * @return bool. | |
| 77 | + * @return bool | |
| 78 | 78 | */ |
| 79 | 79 | public static function set_option( $option, $value ) { |
| 80 | 80 | $options = self::get_options(); |
| 81 | 81 | |
| @@ -150,11 +150,15 @@ | ||
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | 152 | * Default Stats related options. |
| 153 | 153 | * |
| 154 | + * Exposed so consumers (e.g. the Abilities API surface) can introspect | |
| 155 | + * each option's default value and infer its type without redeclaring | |
| 156 | + * a parallel allow-list of bool/array fields. | |
| 157 | + * | |
| 154 | 158 | * @return array |
| 155 | 159 | */ |
| 156 | - protected static function get_defaults() { | |
| 160 | + public static function get_defaults() { | |
| 157 | 161 | return array( |
| 158 | 162 | 'admin_bar' => true, |
| 159 | 163 | 'roles' => array( 'administrator' ), |
| 160 | 164 | 'count_roles' => array(), |
| @@ -165,7 +169,8 @@ | ||
| 165 | 169 | 'enable_odyssey_stats' => true, |
| 166 | 170 | 'odyssey_stats_changed_at' => 0, |
| 167 | 171 | 'notices' => array(), |
| 168 | 172 | 'views' => 0, |
| 173 | + 'honor_cookie_consent' => false, | |
| 169 | 174 | ); |
| 170 | 175 | } |
| 171 | 176 | } |