*/ public function tabs() { $tabs = array( 'overview' => __( 'Overview', 'birchtoad' ), 'widget' => __( 'Widget', 'birchtoad' ), 'features' => __( 'Features', 'birchtoad' ), 'statement' => __( 'Statement', 'birchtoad' ), 'languages' => __( 'Languages', 'birchtoad' ), 'advanced' => __( 'Advanced', 'birchtoad' ), ); /** * Filters the admin tabs. * * @param array $tabs Tab slug to label. */ $tabs = apply_filters( 'birchtoad_admin_tabs', $tabs ); if ( ! birchtoad_is_pro() ) { $tabs['upgrade'] = __( 'Free vs Pro', 'birchtoad' ); } return $tabs; } /** * The tab being viewed. * * @return string */ private function current_tab() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reading which tab to display, not acting on it. $tab = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : 'overview'; $tabs = $this->tabs(); return isset( $tabs[ $tab ] ) ? $tab : 'overview'; } /** * Loads the admin stylesheet and script on our own screen only. * * @param string $hook Current admin page hook. * @return void */ public function enqueue( $hook ) { // The menu icon rule is registered as a style with no source and added inline, rather // than echoed into admin_head. WordPress.org rejected an inline