diff --git a/inc/class-options-page.php b/inc/class-options-page.php index 8cabe869709dc2b5759e12be48e98f719fcf35a9..7fbb5260f6b689218a799117b3ccf4a8d3c87907 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 492720515ef80189d36467797337d932b7b936e2..67ff87b0dea184b1ab7438732018a9439fbc0b6b 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 *