From d4f73c32824e8f3e627939845bab8ade184f463c Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Sun, 18 Feb 2018 13:22:09 -0800 Subject: [PATCH] Futher options-page prep --- inc/class-options-page.php | 20 ++++++++++++++++++++ inc/class-options.php | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/inc/class-options-page.php b/inc/class-options-page.php index 8cabe86..7fbb526 100644 --- a/inc/class-options-page.php +++ b/inc/class-options-page.php @@ -7,6 +7,26 @@ namespace Camo_Image_Proxy; +/** + * Class Options_Page + */ class Options_Page { use Singleton; + + /** + * Hooks + */ + public function setup() { + add_action( 'admin_init', [ $this, 'action_admin_init' ] ); + } + + /** + * Add fields to Media settings page + */ + public function action_admin_init() { + //register_setting(); + + //add_settings_section(); + //add_settings_field(); + } } diff --git a/inc/class-options.php b/inc/class-options.php index 4927205..67ff87b 100644 --- a/inc/class-options.php +++ b/inc/class-options.php @@ -30,6 +30,22 @@ class Options { 'key' => '', ]; + /** + * Access certain private properties + * + * @param string $name Property name. + * @return mixed + */ + public function __get( string $name ) { + switch ( $name ) { + case 'name': + return $this->name; + + default: + return new \WP_Error( 'invalid-property', __( 'Invalid property requested.', 'camo-image-proxy' ), $name ); + } + } + /** * Retrieve full plugin options * -- GitLab