Only load admin CSS when showing settings page #345
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
The
styles-admin.css
file currently loads even on the front-end pages of a site. Visitors should not be loading an extra request for admin-related styles, nor should unrelated admin pages.This PR changes the enqueue of
styles-admin.css
to only happen when loading the settings page. While this CSS currently only affects the logging table, the naming suggests it could be used for any of the admin UI, which is only the settings page.How to test the changes in this Pull Request:
styles-admin.css
loading.styles-admin.css
loading.Other information:
Note: I wasn't able to get the tests running properly to inspect/add tests, but hopefully this change should be both easy to review and easy to test manually, which may not require automated tests. If not, I can work on troubleshooting the docker-compose error I was getting in trying to run tests.
Changelog entry
Only load admin CSS when showing settings page.