tabs = array( 'general' => array( 'title' => _x( 'General', 'settings tab title', 'audioigniter' ), 'callback' => array( $this, 'tab_general' ), ), ); } /** * Register the page * * @since 2.0.0 * * @return void */ public function register() { $page_slug = 'edit.php?post_type=' . AudioIgniter()->post_type; add_submenu_page( $page_slug, __( 'AudioIgniter Settings', 'audioigniter' ), __( 'Go Pro!', 'audioigniter' ), 'manage_options', self::$page_slug, array( $this, 'render_page' ) ); } /** * Renders the onboarding page. * * @since 2.0.0 */ public function render_page() { $active_tab = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification if ( ! array_key_exists( $active_tab, $this->tabs ) ) { reset( $this->tabs ); $active_tab = key( $this->tabs ); } ?>