Skip to content

Commit

Permalink
Add admin_navigation_appearance filter
Browse files Browse the repository at this point in the history
  • Loading branch information
zerocrates committed Mar 5, 2021
1 parent 7ca6578 commit 51a7030
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions source/Reference/filters/admin_navigation_appearance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
###########################
admin_navigation_appearance
###########################

.. versionadded:: 2.5.1

*****
Usage
*****

Filters the navigation for the appearance settings pages of the admin theme.

*****
Value
*****

``array`` $nav
An array of arrays as used by Zend_Navigation.


*********
Arguments
*********

None


********
Examples
********

The array that forms the basis for the appearance navigation is:

.. code-block:: php
$navArray = array(
array(
'label' => __('Themes'),
'uri' => url('themes'),
'resource' => 'Themes',
'privilege' => 'edit'
),
array(
'label' => __('Navigation'),
'uri' => url('appearance/edit-navigation')
),
array(
'label' => __('Settings'),
'uri' => url('appearance/edit-settings')
),
);
To add a new link to the appearance nav, you would use this filter like this:

.. code-block:: php
public function filterAdminNavigationAppearance($nav)
{
$nav[] = array(
'label' => __('My Plugin Settings'),
'uri' => url('my-plugin/settings')
);
return $nav;
}

0 comments on commit 51a7030

Please sign in to comment.