PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.8
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.8
1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 0.8.6 All 33 releases
desktop-mode / includes / framework / app / wordpress / class-settings.php

class-settings.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.8, at includes/framework/app/wordpress/class-settings.php

36 lines 952 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * OpenStation App Framework — WordPress Settings adapter.
4 *
5 * User preferences come from the OpenStation Preferences blob
6 * (`openstation_get_os_settings()`), site options from `get_option()`.
7 *
8 * @package OpenStation
9 */
10
11 namespace OpenStation\App\WordPress;
12
13 use OpenStation\App\Contracts\Settings as SettingsContract;
14
15 defined( 'ABSPATH' ) || exit;
16
17 /**
18 * OpenStation Preferences + site options.
19 */
20 final class Settings implements SettingsContract {
21
22 /** {@inheritDoc} */
23 public function user_preference( $key, $fallback = null ) {
24 if ( ! function_exists( 'openstation_get_os_settings' ) ) {
25 return $fallback;
26 }
27 $settings = openstation_get_os_settings( get_current_user_id() );
28 return is_array( $settings ) && array_key_exists( $key, $settings ) ? $settings[ $key ] : $fallback;
29 }
30
31 /** {@inheritDoc} */
32 public function site_option( $key, $fallback = null ) {
33 return get_option( (string) $key, $fallback );
34 }
35 }
36