Skip to content

Plugin Proposal: Manage inserting of Code Snippets #2322

@pbearne

Description

@pbearne

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

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Not Started/Backlog 📆

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions