-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add admin_navigation_appearance filter
- Loading branch information
1 parent
7ca6578
commit 51a7030
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||