A Snippet Bundle is a collection of snippets grouped together. It provides a simple way to organize your snippets, import them into your website, or share them with other Code Snippets users.
Bundle Visibility
Bundles can be either Private or Public. Public bundles are visible to the entire Code Snippets community, while private bundles are only visible to you.
By default, all bundles are set to private. To make a bundle public, go to the bundle page and click the Edit Bundle button to enter Edit Mode. Then scroll to the Bundle Visibility section and check the “Make Public / Shareable?” option. Click Save to apply your changes.
Note: All snippets within a bundle must be public before the bundle can be made public.
Adding Snippets to a Bundle
You can add any number of snippets to a bundle. To do so, open the snippet page and click the Bundle link in the actions panel below the code editor. A popup will appear, allowing you to add the snippet to any of your available bundles. You can also create a new bundle directly from the popup.
Note: You can add both your own snippets and public snippets from other users.
To remove a snippet from a bundle, you’ll need to edit the bundle. See below for more details.
Editing a Bundle
To edit a bundle, click the Edit Bundle button. This will take you into Bundle Edit Mode, where you can:
- Edit the bundle’s name and description
- Set the bundle’s visibility (Public or Private)
- Remove snippets from the bundle
- Delete the bundle entirely
Bundle Share Code
For public bundles, you can generate a Bundle Share Code that allows other users to import the entire bundle into their own WordPress site using the Code Snippets plugin.
You’ll find the share code on the bundle page. Copy and share it with others so they can easily import the bundle.
How to Use the Share Code
Users can import a shared bundle by opening the Bundles tab in the Code Snippets plugin. There, they can paste the Bundle Share Code to view and import all snippets included in the bundle.