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 ); } ?>


generate_tabs( $active_tab ); ?>
tabs as $tab => $tab_info ) : ?>
tabs[ $active_tab ]['callback'] ) ) { call_user_func( $this->tabs[ $active_tab ]['callback'], $active_tab ); } ?>
TODO: Leave disabled option below and write some upsell stuff. Maybe add images. Or replace everything with upsell info.

'ai_playlist', 'page' => self::$page_slug, ), admin_url( 'edit.php' ) ); } /** * Returns the URL of a specific tab. * * @since 2.0.0 * * @return string */ private function get_tab_url( $tab ) { return add_query_arg( array( 'tab' => $tab, ), $this->get_page_url() ); } }