WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Code Snippets

An easy, clean and simple way to add code snippets to your site.

= 1.9.1.1 * Add capability check to site snippets importer

1.9.1

  • Use an icon font for menu icon instead of embedded SVG
  • Use Sass (libsass) instead of Compass
  • Unminify CodeMirror scripts
  • Fixes for the WP 3.8 interface
  • Fix 'enable snippets menu for site admins' multisite setting

1.9

  • Add and remove network capabilities as super admins are added and removed
  • Updated MP6 icon implementation
  • Replaced buggy trim <?php and ?> functionality with a much more reliable regex method (#)
  • Added French translation thanks to translator oWEB
  • Fixed snippet failing to save when code contains % character, props to nikan06 (#)
  • Added 'Save & Deactivate' button to the edit snippet page (#)
  • Removed edit and install capabilities (now only uses the manage capability)
  • Fixed HTML breaking in export files (#)
  • Make the title of each snippet on the manage page a clickable link to edit the snippet (#)
  • Added nonce to edit snippet page
  • Hide row actions on manage snippet page by default
  • Removed screenshots from plugin
  • Improved CodeMirror implementation
  • Added a fallback MP6 icon
  • Use the proper WordPress database APIs all of the time
  • Rewritten export functionality
  • Fixed incorrect export filename
  • Updated CodeMirror to version 3.19
  • Removed CodeMirror bundled with plugin
  • Updated WordPress.org plugin banner
  • Fixed CodeMirror incompatibility with the WP Editor plugin
  • Fixed CodeMirror incompatibility with the Debug Bar Console plugin

1.8.1

  • Compiled all CodeMirror scripts into a single file
  • Use Sass + Compass for CSS
  • Use Grunt for build automation
  • Minify CSS
  • Fixed code typo that was breaking export files
  • Updated CodeMirror to 3.15

1.8

  • Allow no snippet name or code to be set
  • Prevented an error on fresh multisite installations
  • Refactored code to use best practices
  • Improved database table creation method: on a single-site install, the snippets table will always be created. On a multisite install, the network snippets table will always be created; the site-specific table will always be created for the main site; for sub-sites the snippets table will only be created on a visit to a snippets admin page.
  • Updated to CodeMirror 3.14
  • Changes to action and filter hook API
  • Added error message handling for import snippets page
  • Don't encode HTML entities in database

1.7.1.2

  • Correct path to admin menu icon (#)

1.7.1.1

  • Fix a minor bug with custom capabilities and admin menus

1.7.1

  • Fix a bug with snippet being set as deactivated when saved
  • Updated PHP Documentation completely. View online
  • Only load admin functions when viewing dashboard
  • Added German translation thanks to David Decker
  • Allow or deny site administrators access to snippet admin menus. Set your preference in the Enable Administration Menus setting under the Settings > Network Settings network admin menu.
  • Improve database table creation and upgrade process
  • Optimized to use less database queries

1.7

  • Improved plugin API
  • Fixed a bug with saving snippets per page option (#)
  • Updated CodeMirror to version 3.11
  • Allow plugin to be activated on individual sites on multisite (#)
  • Slimmed down the description visual editor
  • Added icon for the new MP6 admin UI (#)
  • Strip PHP tags from the beginning and end of a snippet in case someone forgets
  • Changed to MIT license
  • Removed HTML, CSS and JavaScript CodeMirror modes that were messing things up
  • Made everything leaner, faster, and better

1.6.1

  • Fixed a bug with permissions not being applied on install (#)
  • Fixed a bug in the uninstall method (#)

1.6

  • Updated code editor to use CodeMirror 3
  • Improved compatibility with Clean Options plugin
  • Code improvements and optimization
  • Changed namespace from cs to code_snippets
  • Move css and js under assets
  • Organized CodeMirror scripts
  • Improved updating process
  • Current line of code editor is now highlighted
  • Highlight matches of selected text in code editor
  • Only create snippet tables when needed
  • Store multisite only options in site options table
  • Fixed compatibility bugs with WordPress 3.5

1.5

  • Updated CodeMirror to version 2.33
  • Updated the 'Manage Snippets' page to use the WP_List_Table class
    • Added 'Screen Options' tab to 'Manage Snippets' page
    • Added search capability to 'Manage Snippets' page
    • Added views to easily filter activated, deactivated and recently activated snippets
    • Added ID column to 'Manage Snippets' page
    • Added sortable name and ID column on 'Manage Snippets' page (#)
  • Added custom capabilities
  • Improved API
  • Added 'Export to PHP' feature (#)
  • Lengthened snippet name field to 64 characters (#)
  • Added i18n

1.4

  • Added interface to Network Dashboard
  • Updated uninstall to support multisite
  • Replaced EditArea with CodeMirror
  • Small improvements

1.3.2

  • Fixed a bug with version 1.3.1

1.3.1

  • Changed plugin website URI
  • Cleaned up some code

1.3

  • Added export option to 'Manage Snippets' page
  • Added 'Import Snippets' page

1.2

  • Minor improvements
  • Added code highlighting
  • Removed 'Uninstall Plugin' page
  • Data will now be cleaned up when plugin is deleted through WordPress admin

1.1

  • Fixed a permissions bug with DISALLOW_FILE_EDIT being set to true (#)
  • Fixed a bug with the page title reading 'Add New Snippet' on the 'Edit Snippets' page
  • Fixed a bug not allowing the plugin to be Network Activated (#)

1.0

  • Stable version released.

Requires: 3.3 or higher
Compatible up to: 3.9.1
Last Updated: 2014-5-8
Downloads: 39,957

Ratings

4 stars
4.8 out of 5 stars

Support

0 of 3 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

2 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,2,2 100,2,2
100,1,1 67,3,2 100,1,1 100,3,3 100,3,3 100,6,6 100,1,1
100,3,3
25,4,1 100,1,1 100,2,2
75,4,3 67,3,2 100,1,1
50,2,1
100,1,1
100,2,2
100,1,1
75,4,3
100,1,1
100,2,2