Document AdminOnlyMenuItem in hooks documentation

pull/5897/head
Matt Westcott 2020-03-19 17:57:52 +00:00
rodzic 205249b317
commit 3f86de27e0
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -160,7 +160,9 @@ Hooks for building new areas of the admin interface (alongside pages, images, do
:attrs: additional HTML attributes to apply to the link
:order: an integer which determines the item's position in the menu
``MenuItem`` can be subclassed to customise the HTML output, specify JavaScript files required by the menu item, or conditionally show or hide the item for specific requests (for example, to apply permission checks); see the source code (``wagtail/admin/menu.py``) for details.
For menu items that are only available to superusers, the subclass ``wagtail.admin.menu.AdminOnlyMenuItem`` can be used in place of ``MenuItem``.
``MenuItem`` can be further subclassed to customise the HTML output, specify JavaScript files required by the menu item, or conditionally show or hide the item for specific requests (for example, to apply permission checks); see the source code (``wagtail/admin/menu.py``) for details.
.. code-block:: python