From dcdca4d4d289028225de0393e1741d9595e861eb Mon Sep 17 00:00:00 2001 From: Max Rice Date: Tue, 19 Nov 2013 03:01:14 -0500 Subject: [PATCH] Remove API settings tab Part of #4055 --- includes/admin/class-wc-admin-settings.php | 1 - .../settings/class-wc-settings-rest-api.php | 116 ------------------ 2 files changed, 117 deletions(-) delete mode 100644 includes/admin/settings/class-wc-settings-rest-api.php diff --git a/includes/admin/class-wc-admin-settings.php b/includes/admin/class-wc-admin-settings.php index b91007ecbb1..3748c84af65 100644 --- a/includes/admin/class-wc-admin-settings.php +++ b/includes/admin/class-wc-admin-settings.php @@ -35,7 +35,6 @@ class WC_Admin_Settings { $settings[] = include( 'settings/class-wc-settings-shipping.php' ); $settings[] = include( 'settings/class-wc-settings-tax.php' ); $settings[] = include( 'settings/class-wc-settings-emails.php' ); - $settings[] = include( 'settings/class-wc-settings-rest-api.php' ); $settings[] = include( 'settings/class-wc-settings-integrations.php' ); $settings = apply_filters( 'woocommerce_get_settings_pages', $settings ); diff --git a/includes/admin/settings/class-wc-settings-rest-api.php b/includes/admin/settings/class-wc-settings-rest-api.php deleted file mode 100644 index 17c9a353440..00000000000 --- a/includes/admin/settings/class-wc-settings-rest-api.php +++ /dev/null @@ -1,116 +0,0 @@ -id = 'api'; - $this->label = __( 'API', 'woocommerce' ); - - add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); - add_action( 'woocommerce_settings_' . $this->id, array( $this, 'output' ) ); - add_action( 'woocommerce_settings_save_' . $this->id, array( $this, 'save' ) ); - add_action( 'woocommerce_sections_' . $this->id, array( $this, 'output_sections' ) ); - } - - /** - * Get sections - * - * @return array - */ - public function get_sections() { - $sections = array( - '' => __( 'API Options', 'woocommerce' ), - 'log' => __( 'Log', 'woocommerce' ) - ); - - return $sections; - } - - /** - * Output the settings - */ - public function output() { - global $current_section; - - $settings = $this->get_settings( $current_section ); - - WC_Admin_Settings::output_fields( $settings ); - } - - /** - * Save settings - */ - public function save() { - global $current_section; - - $settings = $this->get_settings( $current_section ); - WC_Admin_Settings::save_fields( $settings ); - } - - /** - * Get settings array - * - * @param string $current_section - * @return array - */ - public function get_settings( $current_section = '' ) { - - if ( $current_section == 'log' ) { - - // TODO: implement log display - - } else { - - return apply_filters( 'woocommerce_api_settings', array( - - array( 'title' => __( 'General Options', 'woocommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ), - - array( - 'title' => __( 'Enable API', 'woocommerce' ), - 'id' => 'woocommerce_api_enabled', - 'type' => 'checkbox', - 'default' => 'yes', - ), - - array( - 'title' => __( 'Allow read-only public access to Products endpoint', 'woocommerce' ), - 'desc' => __( 'This enables read-only public access to the products endpoint', 'woocommerce' ), - 'id' => 'woocommerce_api_public_products_endpoint', - 'type' => 'checkbox', - 'default' => 'no', - ), - - array( 'type' => 'sectionend', 'id' => 'general_options' ), - - array( 'title' => __( 'API Keys', 'woocommerce' ), 'type' => 'title', 'id' => 'api_key_options' ), - - // TODO: implement key management here - - array( 'type' => 'sectionend', 'id' => 'digital_download_options' ), - - )); - } - } -} - -endif; - -return new WC_Settings_REST_API();