
Creates menu in WordPress’s Appearances -> Menus & generates list HTML from it.
Allows custom-set classes & IDs for elements for easier styling & has easy way to automatically add “Skip to Content” link for screen-reader users.
Since admin menus need to be created before initialization to work in the WordPress admin & used later in template files to print, admin menu objects are handled through static methods in the WPAdminMenuManager singleton class.
1st, before admin loads, call the “createAdminMenu” method on WPAdminMenuManager with a slug & title as the 1st 2 mandatory, & a hash map o’ other attributes as an optional 3rd argument. This will make the menu appear under the given name in Appearances -> Menus in the WordPress admin.
Then you can print the menu through PHP in template files or shortcodes in WordPress content editors.
= PHP
To use through PHP, just call the “printAdminMenu” method on the WPAdminMenuManager class with the mandatory argument o’ the slug representing the admin you want to print ( given when creating the menu earlier ) & an optional hash map o’ attributes to o’erride the ones given when creating the menu, if you want to print the same menu in different places with different element classes, for instance.
= Shortcodes
To print through shortcodes, just use the shortcode [admin-menu slug=”%slug%”], with optional extra attributes to o’erride the attributes given when creating the menu.
WPAdminMenuManager also has 2 templates for easier creation o’ admin menus, a header & footer template. Just call WPAdminMenuManager::createHeaderMenu() or WPAdminMenuManager::createFooterMenu() respectively to create them & either call WPAdminMenuManager::printHeaderMenu() or WPAdminMenuManager::printFooterMenu() or use the shortcodes [header-nav] or [footer-nav].
If you try to print a menu that hasn’t been created yet, it will print nothing.
Valid attributes for admin menus ( all are optional ):
Shortcode attributes that act as these:
// functions.php
declare( strict_types = 1 ); namespace MyTheme { use WaughJ\WPAdminMenuManager\WPAdminMenumanager; // Make sure this is initialized early, // so WordPress Admin knows that this menu is set up. WPAdminMenuManager::createAdminMenu ( 'extra-menu', 'Extra Menu', [ 'nav' => [ 'class' => 'extra-menu-nav', 'id' => 'extra-menu-nav' ], 'ul' => [ 'class' => 'extra-menu-list', 'id' => 'extra-menu-list' ], 'li' => [ 'class' => 'extra-menu-item' ], 'a' => [ 'class' => 'extra-menu-link' ], 'subnav' => [ 'class' => 'extra-menu-subnav' ], 'subitem' => [ 'class' => 'extra-menu-subitem' ], 'sublink' => [ 'class' => 'extra-menu-sublink' ], 'parent-link' => [ 'class' => 'extra-menu-parent-link' ], 'skip-to-content' => 'top' ] ); } // inc/header.php <?php declare( strict_types = 1 ); namespace MyTheme { use WaughJ\WPAdminMenuManager\WPAdminMenumanager; ?> <header class="header"> <?php WPAdminMenuManager::printAdminMenu( 'extra-menu' ); ?> </header> <?php } Starting from $0 per month.
Rating
Reviewers
No reviews
Tags
Developed By
waughjai
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Display clean code snippets with syntax highlighting to improve technical content and help developers scan examples quickly.
Add a comments system with replies, voting, and moderation to boost engagement and build an active community on your site.
Show RSS content with an RSS feed carousel that updates automatically, displays posts in a smooth scrolling layout, and keeps visitors engaged.
Create custom calculators that let visitors enter values, get results, and make confident choices that support your business.
Add a testimonials slider to your site to showcase real customer feedback, build credibility, and increase trust that leads to higher conversions.
Create real estate listings with a listings widget that displays properties clearly, supports customization, and helps visitors explore homes more easily.
Showcase visuals with an image slider that displays multiple images in a smooth slideshow, improves design, and keeps visitors engaged.
Show Glassdoor reviews to highlight employee feedback, strengthen employer brand, and help candidates trust your company.
Use an image magnifier to let visitors zoom in on photos, view fine details clearly, and enjoy a more accessible and informative visual experience.
Show progress with animated progress circles that visualize goals, display achievements, and keep visitors engaged.
Encourage interaction with social votes that let visitors like, upvote, and rank content, boosting engagement and guiding better decisions.
Add Messenger Chat to your site to communicate with visitors, offer fast support, and create a smoother user experience across all pages.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
