Can find link in PasteBin here: Add Extra Menu Links In MAINWP Dashboard - Pastebin.com
neatened up a lil bit with hints/tips with whats for what
3 Likes
add_filter( 'mainwp_main_menu', 'mycustom_mainwp_main_menu', 10, 1 );
function mycustom_mainwp_main_menu( $left_menu ) {
$index = 0;
$sub_menu_after = array_splice( $left_menu['mainwp_tab'], $index );
$addition_item = array();
$addition_item[] = 'MORE LINKS'; /* Main TAB without link*/
$addition_item[] = 'extras-item';
$addition_item[] = ''; /* no need for link here*/
$left_menu['mainwp_tab'][] = $addition_item;
$left_menu['mainwp_tab'] = array_merge( $left_menu['mainwp_tab'], $sub_menu_after );
return $left_menu;
}
add_filter( 'mainwp_main_menu_submenu', 'mycustom_mainwp_main_menu_submenu', 10, 1 );
function mycustom_mainwp_main_menu_submenu( $left_submenu ) {
$addition_item = array();
$addition_item[] = 'Logout'; /* Link Heading */
$addition_item[] = 'https://google.com'; /* new URL */
$left_submenu['extras-item'][] = $addition_item;
/* Can Copy'n Paste below codes again into here to create a new link like this image snap: https://prnt.sc/1ylyzvh | https://prnt.sc/1ylz8x0 */
$addition_item = array();
$addition_item[] = 'Support'; /* Link Heading */
$addition_item[] = 'https://google.com'; /* new URL */
$addition_item[] = ''; /* opens in new tab */
$addition_item[] = '_blank'; /* opens in new tab */
$left_submenu['extras-item'][] = $addition_item;
return $left_submenu;
}
Thanks, I dont know how to add my created code here, hence why I made it in pastebin
1 Like
There is a code block in Discourse that you can use to share code.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.