upsidenl/wp-snippet-manager

Manage and insert categorized snippets into TinyMCE editor

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Type:wordpress-plugin

pkg:composer/upsidenl/wp-snippet-manager

v1.6.0 2025-11-05 13:41 UTC

This package is not auto-updated.

Last update: 2025-11-20 12:05:15 UTC


README

A WordPress plugin that allows you to manage and insert reusable text snippets into your content through a simple modal interface.

Description

WP Snippet Manager provides a centralized way to create, organize, and insert frequently-used text snippets into your posts, pages, and custom post types. The plugin integrates seamlessly with WordPress's TinyMCE editor and Advanced Custom Fields (ACF) WYSIWYG fields.

Features

  • Custom Post Type: Manage all your text snippets as a custom post type (default_text) in the WordPress admin
  • Category Organization: Organize snippets using subjects (categories) with the default_text_subject taxonomy
  • TinyMCE Integration: Adds a snippet button to the WordPress classic editor toolbar
  • ACF Integration: Works with ACF WYSIWYG fields with per-field control
  • Search Functionality: Search through snippets by name or filter by category
  • AJAX-Powered Modal: Fast, responsive modal interface for browsing and inserting snippets
  • Secure: Nonce verification and capability checks for all AJAX operations
  • Translation Ready: Includes Dutch (nl_NL) translation and POT file for other languages

Installation

  1. Upload the wp-snippet-manager folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Navigate to "Text snippets" in the WordPress admin menu to start creating snippets

Usage

Creating Snippets

  1. Go to Text snippets > Add new text in the WordPress admin
  2. Enter a title for your snippet (this will be displayed in the modal)
  3. Add your content in the editor (supports rich text and HTML)
  4. Optionally assign one or more subjects (categories) to organize your snippets
  5. Publish the snippet

Managing Subjects

Navigate to Text snippets > Subjects to create and organize snippet categories.

Inserting Snippets

In the WordPress Classic Editor:

  1. Click the snippet button in the TinyMCE toolbar (puzzle piece icon)
  2. Browse snippets by category or use the search box
  3. Select a snippet from the list
  4. Click "Insert Snippet" to add it to your content

In ACF WYSIWYG Fields:

  1. Enable the snippet button for specific WYSIWYG fields in the field settings:
    • Edit the field group
    • Find the WYSIWYG field
    • Enable the "Snippet Button" option
  2. The snippet button will appear in the editor toolbar for that field
  3. Use the same process as above to insert snippets

Requirements

  • WordPress 5.0 or higher
  • PHP 7.0 or higher
  • Optional: Advanced Custom Fields (for ACF integration)

ACF Integration

The plugin automatically detects ACF and adds a "Snippet Button" option to WYSIWYG field settings. This allows you to:

  • Enable or disable the snippet button on a per-field basis
  • Control which editors should have access to snippets
  • Maintain a clean interface by only showing the button where needed

Development

File Structure