From 39170a3262cd92ce25f26f947410ca2eb076b434 Mon Sep 17 00:00:00 2001 From: Lem Smyth Date: Wed, 9 Feb 2022 07:13:33 -0600 Subject: [PATCH] structure for tabbed admin --- classes/LBRY_Admin.php | 16 +++++++++++----- templates/{options_page.php => options-page.php} | 0 2 files changed, 11 insertions(+), 5 deletions(-) rename templates/{options_page.php => options-page.php} (100%) diff --git a/classes/LBRY_Admin.php b/classes/LBRY_Admin.php index 23c5303..a715bf4 100644 --- a/classes/LBRY_Admin.php +++ b/classes/LBRY_Admin.php @@ -41,13 +41,17 @@ class LBRY_Admin public function page_init() { // Register the LBRY Setting array - register_setting(LBRY_SETTINGS_GROUP, LBRY_SETTINGS, array('sanitize_callback' => array($this, 'sanitize'))); + register_setting( + LBRY_SETTINGS_GROUP, + LBRY_SETTINGS, + array( $this, 'sanitize_general_settings' ) + ); // Add Required Settings Sections add_settings_section( LBRY_SETTINGS_SECTION_GENERAL, // ID 'General Settings', // Title - array( $this, 'general_section_info' ), // Callback + array( $this, 'general_section_callback' ), // Callback LBRY_ADMIN_PAGE // Page ); @@ -108,14 +112,16 @@ class LBRY_Admin { // Set class property to be referenced in callbacks $this->options = get_option(LBRY_SETTINGS); - require_once(LBRY_ABSPATH . 'templates/options_page.php'); + require_once( LBRY_ABSPATH . 'templates/options-page.php' ); } + /** * Sanitizes setting input * // COMBAK Potentially sanitize more */ - public function sanitize($input) + + public function sanitize_general_settings( $input ) { if (!empty($input[LBRY_SPEECH_CHANNEL])) { $channel = $input[LBRY_SPEECH_CHANNEL]; @@ -139,7 +145,7 @@ class LBRY_Admin /** * Section info for the General Section */ - public function general_section_info() + public function general_section_callback() { print 'This is where you can configure how LBRYPress will distribute your content:'; } diff --git a/templates/options_page.php b/templates/options-page.php similarity index 100% rename from templates/options_page.php rename to templates/options-page.php