|
@@ -247,10 +247,6 @@ Add an item to the Wagtail admin menu. The callable passed to this hook must ret
|
|
|
- `classname` - additional classes applied to the link.
|
|
|
- `order` - an integer which determines the item's position in the menu.
|
|
|
|
|
|
-```{versionchanged} 5.2
|
|
|
-Use `classname` as the `classnames` keyword argument is deprecated and will be removed in a future release.
|
|
|
-```
|
|
|
-
|
|
|
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 its initialisation 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.
|
|
@@ -370,10 +366,6 @@ Add an item to the Wagtail admin search "Other Searches". Behaviour of this hook
|
|
|
- `attrs` - additional HTML attributes to apply to the link.
|
|
|
- `order` - an integer which determines the item's position in the list of options.
|
|
|
|
|
|
-```{versionchanged} 5.2
|
|
|
-Use `classname` as the `classnames` keyword argument is deprecated and will be removed in a future release.
|
|
|
-```
|
|
|
-
|
|
|
Setting the URL can be achieved using reverse() on the target search page. The GET parameter 'q' will be appended to the given URL.
|
|
|
|
|
|
A template tag, `search_other` is provided by the `wagtailadmin_tags` template module. This tag takes a single, optional parameter, `current`, which allows you to specify the `name` of the search option currently active. If the parameter is not given, the hook defaults to a reverse lookup of the page's URL for comparison against the `url` parameter.
|
|
@@ -568,10 +560,6 @@ The arguments passed to the hook are as follows:
|
|
|
|
|
|
The `priority` argument controls the order the buttons are displayed in the dropdown. Buttons are ordered from low to high priority, so a button with `priority=10` will be displayed before a button with `priority=60`.
|
|
|
|
|
|
-```{versionchanged} 5.2
|
|
|
-The hook function now receives a `user` argument instead of a `page_perms` argument, and a `view_name` argument. To check the user's permissions on the page, use `page.permissions_for_user(user)`.
|
|
|
-```
|
|
|
-
|
|
|
## Editor workflow
|
|
|
|
|
|
Hooks for customising the way users are directed through the process of creating page content.
|
|
@@ -1026,10 +1014,6 @@ The arguments passed to the hook are as follows:
|
|
|
|
|
|
The `priority` argument controls the order the buttons are displayed in. Buttons are ordered from low to high priority, so a button with `priority=10` will be displayed before a button with `priority=20`.
|
|
|
|
|
|
-```{versionchanged} 5.2
|
|
|
-The hook function now receives a `user` argument instead of a `page_perms` argument. To check the user's permissions on the page, use `page.permissions_for_user(user)`.
|
|
|
-```
|
|
|
-
|
|
|
(register_page_listing_more_buttons)=
|
|
|
|
|
|
### `register_page_listing_more_buttons`
|
|
@@ -1058,10 +1042,6 @@ The arguments passed to the hook are as follows:
|
|
|
|
|
|
The `priority` argument controls the order the buttons are displayed in the dropdown. Buttons are ordered from low to high priority, so a button with `priority=10` will be displayed before a button with `priority=60`.
|
|
|
|
|
|
-```{versionchanged} 5.2
|
|
|
-The hook function now receives a `user` argument instead of a `page_perms` argument. To check the user's permissions on the page, use `page.permissions_for_user(user)`.
|
|
|
-```
|
|
|
-
|
|
|
#### Buttons with dropdown lists
|
|
|
|
|
|
The admin widgets also provide `ButtonWithDropdownFromHook`, which allows you to define a custom hook for generating a dropdown menu that gets attached to your button.
|
|
@@ -1098,10 +1078,6 @@ def page_custom_listing_more_buttons(page, user, next_url=None):
|
|
|
|
|
|
The template for the dropdown button can be customised by overriding `wagtailadmin/pages/listing/_button_with_dropdown.html`. Make sure to leave the dropdown UI component itself as-is.
|
|
|
|
|
|
-```{versionchanged} 5.2
|
|
|
-The `ButtonWithDropdownFromHook` constructor, and the corresponding hook function, now receive a `user` argument instead of a `page_perms` argument.
|
|
|
-```
|
|
|
-
|
|
|
(construct_page_listing_buttons)=
|
|
|
|
|
|
### `construct_page_listing_buttons`
|
|
@@ -1115,10 +1091,6 @@ def remove_page_listing_button_item(buttons, page, user, context=None):
|
|
|
buttons.pop() # removes the last 'more' dropdown button on the root page listing buttons
|
|
|
```
|
|
|
|
|
|
-```{versionchanged} 5.2
|
|
|
-The hook function now receives a `user` argument instead of a `page_perms` argument. To check the user's permissions on the page, use `page.permissions_for_user(user)`.
|
|
|
-```
|
|
|
-
|
|
|
## Page serving
|
|
|
|
|
|
(before_serve_page)=
|
|
@@ -1342,10 +1314,6 @@ def remove_snippet_listing_button_item(buttons, snippet, user):
|
|
|
buttons.pop() # Removes the 'delete' button
|
|
|
```
|
|
|
|
|
|
-```{versionchanged} 5.2
|
|
|
-The `context` argument has been removed from this hook.
|
|
|
-```
|
|
|
-
|
|
|
## Bulk actions
|
|
|
|
|
|
Hooks for registering and customising bulk actions. See [](custom_bulk_actions) on how to write custom bulk actions.
|