v
> */ function trustbio_ap_nav_items(): array { $trustbio_items = array( array( 'slug' => 'trustbio', 'label' => __( 'Overview', 'trustbio' ), 'icon' => 'home' ), array( 'slug' => 'trustbio-features', 'label' => __( 'Features', 'trustbio' ), 'icon' => 'features' ), array( 'slug' => 'trustbio-categories', 'label' => __( 'Categories', 'trustbio' ), 'icon' => 'tag' ), array( 'slug' => 'trustbio-authors', 'label' => __( 'Authors', 'trustbio' ), 'icon' => 'users' ), array( 'slug' => 'trustbio-credentials', 'label' => __( 'Credentials', 'trustbio' ), 'icon' => 'shield-check' ), array( 'slug' => 'trustbio-fields', 'label' => __( 'Author Fields', 'trustbio' ), 'icon' => 'fields' ), array( 'slug' => 'trustbio-boxes', 'label' => __( 'Author Boxes', 'trustbio' ), 'icon' => 'boxes' ), array( 'slug' => 'trustbio-review-bars', 'label' => __( 'Review Bars', 'trustbio' ), 'icon' => 'review', 'feature' => 'review_bars' ), ); /** * Filters the TrustBio admin sidebar nav items. * * The TrustBio Pro add-on appends its own screens here. Every item must * point at a page that is actually registered, so the nav never shows a * link that leads nowhere. * * Each item is array( 'slug', 'label', 'icon' ) plus an optional 'feature' * slug, which hides the item when that module is switched off. An item of * array( 'section' => true, 'label' => '' ) renders a divider. * * @since 1.0.0 * @param array> $items Nav items, in display order. */ $trustbio_items = (array) apply_filters( 'trustbio_admin_nav_items', $trustbio_items ); // Settings always sits last, below a divider. $trustbio_items[] = array( 'section' => true, 'label' => '' ); $trustbio_items[] = array( 'slug' => 'trustbio-settings', 'label' => __( 'Settings', 'trustbio' ), 'icon' => 'settings' ); // One nav entry for the add-on, and only while it is not installed. It // points at a page describing Pro, not at a locked feature. if ( ! trustbio_is_pro() ) { $trustbio_items[] = array( 'slug' => 'trustbio-upgrade', 'label' => __( 'TrustBio Pro', 'trustbio' ), 'icon' => 'bolt', 'class' => 'is-upgrade', ); } return $trustbio_items; } /** * Return an inline SVG for the given icon name. * * @param string $name Icon identifier. * @return string Safe SVG markup. */ function trustbio_ap_svg_icon( string $name ): string { static $icons = null; if ( null === $icons ) { $icons = array( 'logo' => '', 'home' => '', 'tag' => '', 'users' => '', 'fields' => '', 'boxes' => '', 'sidebar' => '', 'review' => '', 'bolt' => '', 'gap' => '', 'ai' => '', 'document' => '', 'shield-check' => '', 'features' => '', 'email' => '', 'settings' => '', ); } return $icons[ $name ] ?? $icons['settings']; }