add_hooks(); } /** * Hook into WordPress. */ public function add_hooks() { add_action( 'admin_menu', array( $this, 'add_to_menu' ), 55 ); add_action( 'wp_ajax_' . static::AJAX_HOOK, array( $this, 'export_settings' ) ); } /** * Add options page to menu */ public function add_to_menu() { add_submenu_page( 'woocommerce', __( 'WooCommerce Settings Import/Export', 'woocommerce-beta-tester' ), __( 'Settings Import/Export', 'woocommerce-beta-tester' ), 'manage_woocommerce', 'wc-beta-tester-import-export', array( $this, 'settings_page_html' ) ); } /** * Output settings HTML */ public function settings_page_html() { if ( ! current_user_can( 'manage_woocommerce' ) ) { return; } ?>
get_settings() ); exit; } /** * Get an array of the WooCommerce related settings. */ protected function get_settings() { $settings = array(); if ( current_user_can( 'manage_woocommerce' ) ) { require_once(dirname(__FILE__) . '/wc-beta-tester-settings-list.php'); foreach (wp_beta_tester_setting_list() as $option_name) { $settings[$option_name] = get_option($option_name); } } return $settings; } }