Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[N/A] Add Custom Scripts Tools Page #165

Merged
merged 2 commits into from
Jan 13, 2025
Merged

[N/A] Add Custom Scripts Tools Page #165

merged 2 commits into from
Jan 13, 2025

Conversation

bd-viget
Copy link
Contributor

Summary

This PR adds a Custom Scripts page to the Tools menu, allowing admins to insert custom scripts into the <head> and <body> tags. This will render globally and do not have any way of rendering conditionally.

Issues

  • N/A

Testing Instructions

  1. Visit WP Admin
  2. Go to Tools > Custom Scripts
  3. Add custom scripts
  4. Save changes
  5. Review to ensure they are rendered properly on the front-end.

Screenshots

Screenshot 2025-01-12 at 1 21 47 PM

@bd-viget bd-viget self-assigned this Jan 12, 2025
Copy link
Contributor

@nathan-schmidt-viget nathan-schmidt-viget left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! My only global thought is limiting this to only admin users. So editors and the other users don't have access to potentially mess up the site, if they added a bad script.

@bd-viget
Copy link
Contributor Author

@nathan-schmidt-viget

Looks good! My only global thought is limiting this to only admin users. So editors and the other users don't have access to potentially mess up the site, if they added a bad script.

The page should only be accessible by users with manage_options capabilities: https://github.com/vigetlabs/wordpress-site-starter/pull/165/files#diff-ce698d7571f4d899426da839ef8299a6f05b2e7131ecdd0cbe909591c1326bceR237

@bd-viget bd-viget merged commit 775ddd0 into main Jan 13, 2025
@bd-viget bd-viget deleted the bd/custom-scripts branch January 13, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants