diff --git a/docs/reference/hooks.md b/docs/reference/hooks.md index 85f47e9966..51ce4e9de0 100644 --- a/docs/reference/hooks.md +++ b/docs/reference/hooks.md @@ -466,30 +466,6 @@ Hooks for customising the editing interface for pages and snippets. Rich text fields in Wagtail work with a list of 'feature' identifiers that determine which editing controls are available in the editor, and which elements are allowed in the output; for example, a rich text field defined as `RichTextField(features=['h2', 'h3', 'bold', 'italic', 'link'])` would allow headings, bold / italic formatting and links, but not (for example) bullet lists or images. The `register_rich_text_features` hook allows new feature identifiers to be defined - see [](rich_text_features) for details. -(insert_editor_css)= - -### `insert_editor_css` - -Add additional CSS files or snippets to the page editor. - -```python -from django.templatetags.static import static -from django.utils.html import format_html - -from wagtail import hooks - -@hooks.register('insert_editor_css') -def editor_css(): - return format_html( - '', - static('demo/css/vendor/font-awesome/css/font-awesome.min.css') - ) -``` - -```{note} -The `insert_editor_css` hook is deprecated and will be removed in a future release. We recommend using [](insert_global_admin_css) instead. -``` - (insert_global_admin_css)= ### `insert_global_admin_css` diff --git a/wagtail/admin/templates/wagtailadmin/admin_base.html b/wagtail/admin/templates/wagtailadmin/admin_base.html index d2423a9053..f6c3707c12 100644 --- a/wagtail/admin/templates/wagtailadmin/admin_base.html +++ b/wagtail/admin/templates/wagtailadmin/admin_base.html @@ -5,7 +5,6 @@ {% hook_output 'insert_global_admin_css' %} - {% hook_output 'insert_editor_css' %} {% block extra_css %}{% endblock %} {% endblock %} diff --git a/wagtail/admin/templates/wagtailadmin/userbar/base.html b/wagtail/admin/templates/wagtailadmin/userbar/base.html index 520f2c1425..d4d7dfe91e 100644 --- a/wagtail/admin/templates/wagtailadmin/userbar/base.html +++ b/wagtail/admin/templates/wagtailadmin/userbar/base.html @@ -5,7 +5,6 @@
{% hook_output 'insert_global_admin_css' %} - {% hook_output 'insert_editor_css' %}
diff --git a/wagtail/admin/templatetags/wagtailadmin_tags.py b/wagtail/admin/templatetags/wagtailadmin_tags.py index 40d646be19..2afcf6eca1 100644 --- a/wagtail/admin/templatetags/wagtailadmin_tags.py +++ b/wagtail/admin/templatetags/wagtailadmin_tags.py @@ -278,12 +278,6 @@ def hook_output(hook_name): """ snippets = [fn() for fn in hooks.get_hooks(hook_name)] - if hook_name == "insert_editor_css" and snippets: - warn( - "The `insert_editor_css` hook is deprecated - use `insert_global_admin_css` instead.", - category=RemovedInWagtail60Warning, - ) - return mark_safe("".join(snippets)) diff --git a/wagtail/admin/tests/tests.py b/wagtail/admin/tests/tests.py index a8dbd9f0ad..8461d78370 100644 --- a/wagtail/admin/tests/tests.py +++ b/wagtail/admin/tests/tests.py @@ -11,7 +11,6 @@ from django.urls import reverse, reverse_lazy from django.utils.translation import gettext_lazy as _ from taggit.models import Tag -from wagtail import hooks from wagtail.admin.auth import user_has_any_page_permission from wagtail.admin.mail import send_mail from wagtail.admin.menu import MenuItem @@ -19,7 +18,6 @@ from wagtail.models import Page from wagtail.test.testapp.models import RestaurantTag from wagtail.test.utils import WagtailTestUtils from wagtail.utils.deprecation import ( - RemovedInWagtail60Warning, RemovedInWagtail70Warning, ) @@ -160,20 +158,6 @@ class TestEditorHooks(WagtailTestUtils, TestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, '') - def test_deprecated_editor_css_hook(self): - def css_hook(): - return '' - - with self.assertWarnsMessage( - RemovedInWagtail60Warning, - "The `insert_editor_css` hook is deprecated - use `insert_global_admin_css` instead.", - ): - with hooks.register_temporarily("insert_editor_css", css_hook): - response = self.client.get(reverse("wagtailadmin_home")) - self.assertContains( - response, '' - ) - class TestSendMail(TestCase): def test_send_email(self):