backend_sidebar
Allows adding custom content to the app’s main sidebar.
Teamwork
Input (passed by reference)
No specific parameters.
… your plugin code …
Output
{$backend_sidebar.top_li}
HTML code of a custom
<li> element as an item of the menu with the .menu class at the top of the sidebar.{$backend_sidebar.bottom_li}
HTML code of a custom
<li> element as an item of the menu with the .menu class at the bottom of the sidebar.{$backend_sidebar.section}
HTML code of a custom block in the middle part of the sidebar.
Teamwork
Plugin code example
PHP
public function backendSidebar()
{
return [
'top_li' => sprintf(
'<li><a href="#/myplugin/section_one/"><i class="fas fa-sun text-orange"></i><span>%s</span></a></li>',
_wp('My plugin’s top menu item')
),
'bottom_li' => sprintf(
'<li><a href="#/myplugin/section_two/"><i class="fas fa-moon text-blue"></i><span>%s</span></a></li>',
_wp('My plugin’s bottom menu item')
),
'section' => sprintf(
'<h5 class="heading">%s</h5><div class="box custom-my-16 hint align-center">%s</div>',
_wp('Custom header'),
_wp('Custom hint for plugin users.')
),
];
}









