-
Notifications
You must be signed in to change notification settings - Fork 143
Plugin Proposal: Manage inserting of Code Snippets #2322
Description
Overview
- Proposed plugin name: Code Snippets
- Proposed plugin slug: code-snippets
- Proposed plugin owner GitHub username(s): pbearne
About the plugin
Purpose
Create admin settings to allow management of Code Snippets so WP can control where and how they are added to rendered HTML.
Scope
Adds a WP settings page that enables adding/selecting of script blocks and allows the options to be managed
Rationale
There are lots of instructions ( GTM Code Snippets) on the web to add script blocks and sometimes HTML, and these are added to the header in an uncontrolled way or require a plugin.
Other
We create a location to paste the snippet, then parse it (store it as a CPT) to create settings that control how it is loaded/adjusted.
We also allow a JSON block to be pasted in as well to create the settings with options for the scripts that allow
Part of the settings control where the snippets are added to the page and or bundled into larger or external files
We just call the CPT with a meta query in the header/content/footer to insert as needed
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackProjects
Status