diff options
author | Zach van Rijn <me@zv.io> | 2021-07-21 16:19:29 -0500 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2021-07-21 16:19:29 -0500 |
commit | 69c17f9c1942fd0d6a5ea941636e87723b8a6fe2 (patch) | |
tree | e1d0212147048204b0eede0aa6ff79849ed479da /inc/core/class-astra-admin-helper.php | |
parent | 74a7109a2a5ab0d191f26c917ae69e46f0d83b32 (diff) | |
download | blog-ng-69c17f9c1942fd0d6a5ea941636e87723b8a6fe2.tar.gz blog-ng-69c17f9c1942fd0d6a5ea941636e87723b8a6fe2.tar.bz2 blog-ng-69c17f9c1942fd0d6a5ea941636e87723b8a6fe2.tar.xz blog-ng-69c17f9c1942fd0d6a5ea941636e87723b8a6fe2.zip |
dos2unix on all .php files, begin paring down admin page and site branding.
Diffstat (limited to 'inc/core/class-astra-admin-helper.php')
-rw-r--r-- | inc/core/class-astra-admin-helper.php | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/inc/core/class-astra-admin-helper.php b/inc/core/class-astra-admin-helper.php index ea35e7d..1763fff 100644 --- a/inc/core/class-astra-admin-helper.php +++ b/inc/core/class-astra-admin-helper.php @@ -1,87 +1,87 @@ -<?php
-/**
- * Admin settings helper
- *
- * @link https://developer.wordpress.org/themes/basics/theme-functions/
- *
- * @package Astra
- * @author Astra
- * @copyright Copyright (c) 2020, Astra
- * @link https://wpastra.com/
- * @since Astra 1.0
- */
-
-if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly.
-}
-
-if ( ! class_exists( 'Astra_Admin_Helper' ) ) :
-
- /**
- * Admin Helper
- */
- final class Astra_Admin_Helper {
-
- /**
- * Returns an option from the database for
- * the admin settings page.
- *
- * @param string $key The option key.
- * @param boolean $network Whether to allow the network admin setting to be overridden on subsites.
- * @return string Return the option value
- */
- public static function get_admin_settings_option( $key, $network = false ) {
-
- // Get the site-wide option if we're in the network admin.
- if ( $network && is_multisite() ) {
- $value = get_site_option( $key );
- } else {
- $value = get_option( $key );
- }
-
- return $value;
- }
-
- /**
- * Updates an option from the admin settings page.
- *
- * @param string $key The option key.
- * @param mixed $value The value to update.
- * @param bool $network Whether to allow the network admin setting to be overridden on subsites.
- * @return mixed
- */
- public static function update_admin_settings_option( $key, $value, $network = false ) {
-
- // Update the site-wide option since we're in the network admin.
- if ( $network && is_multisite() ) {
- update_site_option( $key, $value );
- } else {
- update_option( $key, $value );
- }
-
- }
-
- /**
- * Returns an option from the database for
- * the admin settings page.
- *
- * @param string $key The option key.
- * @param bool $network Whether to allow the network admin setting to be overridden on subsites.
- * @return mixed
- */
- public static function delete_admin_settings_option( $key, $network = false ) {
-
- // Get the site-wide option if we're in the network admin.
- if ( $network && is_multisite() ) {
- $value = delete_site_option( $key );
- } else {
- $value = delete_option( $key );
- }
-
- return $value;
- }
-
- }
-
-
-endif;
+<?php +/** + * Admin settings helper + * + * @link https://developer.wordpress.org/themes/basics/theme-functions/ + * + * @package Astra + * @author Astra + * @copyright Copyright (c) 2020, Astra + * @link https://wpastra.com/ + * @since Astra 1.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +if ( ! class_exists( 'Astra_Admin_Helper' ) ) : + + /** + * Admin Helper + */ + final class Astra_Admin_Helper { + + /** + * Returns an option from the database for + * the admin settings page. + * + * @param string $key The option key. + * @param boolean $network Whether to allow the network admin setting to be overridden on subsites. + * @return string Return the option value + */ + public static function get_admin_settings_option( $key, $network = false ) { + + // Get the site-wide option if we're in the network admin. + if ( $network && is_multisite() ) { + $value = get_site_option( $key ); + } else { + $value = get_option( $key ); + } + + return $value; + } + + /** + * Updates an option from the admin settings page. + * + * @param string $key The option key. + * @param mixed $value The value to update. + * @param bool $network Whether to allow the network admin setting to be overridden on subsites. + * @return mixed + */ + public static function update_admin_settings_option( $key, $value, $network = false ) { + + // Update the site-wide option since we're in the network admin. + if ( $network && is_multisite() ) { + update_site_option( $key, $value ); + } else { + update_option( $key, $value ); + } + + } + + /** + * Returns an option from the database for + * the admin settings page. + * + * @param string $key The option key. + * @param bool $network Whether to allow the network admin setting to be overridden on subsites. + * @return mixed + */ + public static function delete_admin_settings_option( $key, $network = false ) { + + // Get the site-wide option if we're in the network admin. + if ( $network && is_multisite() ) { + $value = delete_site_option( $key ); + } else { + $value = delete_option( $key ); + } + + return $value; + } + + } + + +endif; |