settings_key); $api_key = $general_options && array_key_exists("api_key", $general_options) ? $general_options['api_key'] : null; $api_secret = $general_options && array_key_exists("api_secret", $general_options) ? $general_options['api_secret'] : null; $this->api = new ConvertKitAPI( $api_key, $api_secret ); add_action('admin_menu', array($this, 'add_settings_page')); add_action('admin_init', array($this, 'register_sections')); } /** * Add the options page */ public function add_settings_page() { $settings = add_options_page( __('ConvertKit'), __('ConvertKit'), 'manage_options', $this->settings_key, array($this, 'display_settings_page') ); add_action('admin_print_styles', array($this, 'admin_styles')); } /** * Options page callback */ public function display_settings_page() { $active_section = (isset($_GET['tab'])) ? $_GET['tab'] : $this->sections[0]->name; ?>
sections) > 1) { $this->display_section_nav($active_section); } else { ?>

sections as $section): if ($active_section == $section->name): $section->render(); endif; endforeach; ?>

If you have questions or problems, please contact support@convertkit.com

is_registerable) { array_push($this->sections, $section_instance); } } /** * Register each section */ public function register_sections() { wp_register_style( 'wp-convertkit-admin', plugins_url('../resources/backend/wp-convertkit.css', __FILE__) ); $this->register_section('ConvertKitSettingsGeneral'); $this->register_section('ConvertKitSettingsWishlistMember'); } } if( is_admin() ) { $convertkit_settings = new ConvertKitSettings(); include 'section/general.php'; include 'section/wishlist_member.php'; }