Post Snippets - Version 1.9

Version Description

Note that starting with this version and moving forward, at least PHP v5.2.4 is required to run Post Snippets.

Download this release

Release Info

Developer artstorm
Plugin Icon 128x128 Post Snippets
Version 1.9
Comparing to
See all releases

Code changes from version 1.8.9.2 to 1.9

Files changed (3) hide show
  1. classes/settings.php +3 -1
  2. post-snippets.php +31 -15
  3. readme.txt +301 -284
classes/settings.php CHANGED
@@ -73,8 +73,10 @@ class Post_Snippets_Settings
73
  <?php
74
  $this->checkbox(__('Shortcode', 'post-snippets'), $key.'_shortcode',
75
  $snippet['shortcode']);
 
 
 
76
  ?>
77
- <!-- <input type='checkbox' name='< ?php echo $i; ? >_php' value='true'< ?php if ($snippets[$i]['php'] == true) { echo " checked"; }? > /> < ?php _e( 'PHP Code', 'post-snippets' ) ? ><br/> -->
78
  </td>
79
  <td class='desc'>
80
  <textarea name="<?php echo $key; ?>_snippet" class="large-text" style='width: 100%;' rows="5"><?php echo htmlspecialchars($snippet['snippet'], ENT_NOQUOTES); ?></textarea>
73
  <?php
74
  $this->checkbox(__('Shortcode', 'post-snippets'), $key.'_shortcode',
75
  $snippet['shortcode']);
76
+
77
+ $this->checkbox(__('PHP Code', 'post-snippets'), $key.'_php',
78
+ $snippet['php']);
79
  ?>
 
80
  </td>
81
  <td class='desc'>
82
  <textarea name="<?php echo $key; ?>_snippet" class="large-text" style='width: 100%;' rows="5"><?php echo htmlspecialchars($snippet['snippet'], ENT_NOQUOTES); ?></textarea>
post-snippets.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Post Snippets
4
  Plugin URI: http://wpstorm.net/wordpress-plugins/post-snippets/
5
  Description: Stores snippets of HTML code or reoccurring text that you often use in your posts. You can use predefined variables to replace parts of the snippet on insert. All snippets are available in the post editor with a TinyMCE button or Quicktags.
6
- Version: 1.8.9.2
7
  Author: Johan Steen
8
  Author URI: http://johansteen.se/
9
  Text Domain: post-snippets
@@ -436,19 +436,42 @@ function edOpenPostSnippets(myField) {
436
  if ( $content != null )
437
  $attributes["content"] = $content;
438
 
439
- $snippet = "'. addslashes($snippet["snippet"]) .'";
 
440
  $snippet = str_replace("&", "&amp;", $snippet);
441
 
442
  foreach ($attributes as $key => $val) {
443
  $snippet = str_replace("{".$key."}", $val, $snippet);
444
  }
445
-
 
 
 
 
 
446
  return do_shortcode(stripslashes($snippet));') );
447
  }
448
  }
449
  }
450
  }
451
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
452
 
453
  /**
454
  * The Admin Page and all it's functions
@@ -782,6 +805,7 @@ class Post_Snippets_Host_Environment
782
  if (version_compare(PHP_VERSION, $this->MIN_PHP_VERSION, '<')) {
783
  // Display notice
784
  add_action( 'admin_notices', array(&$this, 'php_version_error') );
 
785
  }
786
 
787
  // Check if WordPress is too old
@@ -797,16 +821,9 @@ class Post_Snippets_Host_Environment
797
  */
798
  function php_version_error() {
799
  echo '<div class="error"><p><strong>';
800
- printf( __(
801
- 'Notice:<br/>'.
802
- 'When Post Snippets v1.9 will be released, the minimum '.
803
- 'required PHP Version will be %1$s to be on par with WordPress 3.3.'.
804
- '<br/>'.
805
- 'Please update your '.
806
- 'PHP installation before updating Post Snippets to v1.9+, or '.
807
- 'contact the plugin author to plead your case.<br/>'.
808
  'Your installed PHP version: %2$s',
809
- 'post-snippets'),
810
  $this->MIN_PHP_VERSION, PHP_VERSION);
811
  echo '</strong></p></div>';
812
  }
@@ -816,9 +833,8 @@ class Post_Snippets_Host_Environment
816
  */
817
  function wp_version_error() {
818
  echo '<div class="error"><p><strong>';
819
- printf( __(
820
- 'Error: Post Snippets requires WordPress Version %s or higher.',
821
- 'post-snippets'),
822
  $this->MIN_WP_VERSION );
823
  echo '</strong></p></div>';
824
  }
3
  Plugin Name: Post Snippets
4
  Plugin URI: http://wpstorm.net/wordpress-plugins/post-snippets/
5
  Description: Stores snippets of HTML code or reoccurring text that you often use in your posts. You can use predefined variables to replace parts of the snippet on insert. All snippets are available in the post editor with a TinyMCE button or Quicktags.
6
+ Version: 1.9
7
  Author: Johan Steen
8
  Author URI: http://johansteen.se/
9
  Text Domain: post-snippets
436
  if ( $content != null )
437
  $attributes["content"] = $content;
438
 
439
+
440
+ $snippet = \''. addslashes($snippet["snippet"]) .'\';
441
  $snippet = str_replace("&", "&amp;", $snippet);
442
 
443
  foreach ($attributes as $key => $val) {
444
  $snippet = str_replace("{".$key."}", $val, $snippet);
445
  }
446
+
447
+ $php = "'. $snippet["php"] .'";
448
+ if ($php == true) {
449
+ $snippet = Post_Snippets::php_eval( $snippet );
450
+ }
451
+
452
  return do_shortcode(stripslashes($snippet));') );
453
  }
454
  }
455
  }
456
  }
457
 
458
+ /**
459
+ * Evaluate a snippet as PHP code.
460
+ *
461
+ * @since Post Snippets 1.9
462
+ * @param string $content The snippet to evaluate
463
+ * @return string The result of the evaluation
464
+ */
465
+ public static function php_eval( $content )
466
+ {
467
+ $content = stripslashes($content);
468
+
469
+ ob_start();
470
+ eval ($content);
471
+ $content = ob_get_clean();
472
+
473
+ return addslashes( $content );
474
+ }
475
 
476
  /**
477
  * The Admin Page and all it's functions
805
  if (version_compare(PHP_VERSION, $this->MIN_PHP_VERSION, '<')) {
806
  // Display notice
807
  add_action( 'admin_notices', array(&$this, 'php_version_error') );
808
+ $this->passed = false;
809
  }
810
 
811
  // Check if WordPress is too old
821
  */
822
  function php_version_error() {
823
  echo '<div class="error"><p><strong>';
824
+ printf(
825
+ 'Error: Post Snippets requires PHP version %1$s or greater.<br/>'.
 
 
 
 
 
 
826
  'Your installed PHP version: %2$s',
 
827
  $this->MIN_PHP_VERSION, PHP_VERSION);
828
  echo '</strong></p></div>';
829
  }
833
  */
834
  function wp_version_error() {
835
  echo '<div class="error"><p><strong>';
836
+ printf(
837
+ 'Error: Post Snippets requires WordPress version %s or greater.',
 
838
  $this->MIN_WP_VERSION );
839
  echo '</strong></p></div>';
840
  }
readme.txt CHANGED
@@ -1,284 +1,301 @@
1
- === Post Snippets ===
2
- Contributors: artstorm
3
- Donate link: http://wpstorm.net/wordpress-plugins/post-snippets/#donation
4
- Tags: post, admin, snippet, html, custom, page, dynamic, editor, quicktag
5
- Requires at least: 3.0
6
- Tested up to: 3.3.1
7
- Stable tag: 1.8.9.2
8
-
9
- Keep a snippet library of text, HTML or PHP code to be used in posts. Variables
10
- can be set for more flexibility. Inserts directly or as shortcodes.
11
-
12
- == Description ==
13
-
14
- This admin plugin stores snippets of HTML code or reoccurring text that you often use in your posts. You can use predefined variables to replace parts of the snippet on insert. All snippets are available in the post editor with a TinyMCE button. The snippet can be inserted as defined, or as a shortcode to keep flexibility for updating the snippet.
15
-
16
- = Features =
17
-
18
- * **Insert** All defined snippets is inserted from a button directly in the post
19
- editor.
20
- * **Shortcodes** You can use this plugin to create your own shortcodes.
21
- * **Buttons** The snippets are available in the viusal editor with a TinyMCE
22
- button and in the HTML editor with a quicktag button.
23
- * **Admin** Easy to use administration panel where you can add, edit and remove
24
- snippets.
25
- * **Variables** Each snippet can have as many custom variables as you like,
26
- which can be used on insert.
27
- * **Import/Export** Snippets can be imported and exported between sites.
28
- * **Uninstall** If you delete the plugin from your plugins panel it cleans up
29
- all data it has created in the Wordpress database.
30
-
31
- = Related Links =
32
-
33
- * [Documentation](http://wpstorm.net/wordpress-plugins/post-snippets/
34
- "Complete usage instructions")
35
- * [Support Forum](http://wordpress.org/tags/post-snippets?forum_id=10
36
- "Use this for support and feature requests")
37
-
38
- See the [Changelog](http://wordpress.org/extend/plugins/post-snippets/changelog/) for what's new. Available [Translations](http://wpstorm.net/wordpress-plugins/post-snippets/#translations).
39
-
40
-
41
- == Installation ==
42
-
43
- = Requirements =
44
-
45
- * PHP version 5.2.4 or greater.
46
- * WordPress version 3.0 or greater.
47
-
48
- = Install =
49
-
50
- 1. Upload the 'post-snippets' folder to the '/wp-content/plugins/' directory.
51
- 2. Activate the plugin through the 'Plugins' menu in WordPress.
52
- 3. Go to Settings -> Post Snippets and start entering your snippets.
53
-
54
- = Uninstall =
55
-
56
- 1. Deactivate Post Snippets in the 'Plugins' menu in Wordpress.
57
- 2. Select Post Snippets in the 'Recently Active Plugins' section and select
58
- 'Delete' from the 'Bulk Actions' drop down menu.
59
- 3. This will delete all the plugin files from the server as well as erasing all
60
- options the plugin has stored in the database.
61
-
62
- == Frequently Asked Questions ==
63
-
64
- = Why do importing Snippets on a multi site install fail? =
65
-
66
- Upload of zip files must be allowed, enable this in Sites Network Admin -> Settings -> Upload Settings -> Upload file types.
67
-
68
- = How can I use the content in an enclosed shortcode? =
69
-
70
- If the shortcode is enclosed and contains content between the tags in a post.
71
- Example: `[shortcode]Some text[/shortcode]` the text within will be availble in
72
- a variable called content. So in your snippet use {content} to display it. Don't
73
- enter 'content' in the variable field, it's automatically assigned.
74
-
75
- = Where can I get support? =
76
-
77
- Please visit the [Support Forum](http://wordpress.org/tags/post-snippets?forum_id=10 "Use this for support and feature requests")
78
- for questions, answers, support and feature requests.
79
-
80
- == Screenshots ==
81
-
82
- 1. The Admin page where you set up new snippets.
83
- 2. The TinyMCE button for Post Snippets.
84
- 3. The Post Snippet Insert Window.
85
-
86
- == Changelog ==
87
-
88
- = Version 1.8.9.2 - 15 Jan 2012 =
89
- * Added an additional check to see if Post Snippets is loaded via a
90
- bootstrapped WP Admin that doesn't set the is_admin() flag, so it works in
91
- that environment as well.
92
-
93
- = Version 1.8.9.1 - 11 Jan 2012 =
94
- * A bug fixed with get_post_snippets() that were introduced in the last update.
95
- * Unit test for get_post_snippets() added to automate testing that it won't
96
- break in future updates.
97
-
98
- = Version 1.8.9 - 10 Jan 2012 =
99
- * Updated the help text to take advantage of the new Help API introduced with
100
- WordPress 3.3.
101
- * Updated the Swedish translation.
102
-
103
- = Version 1.8.8 - 28 Dec 2011 =
104
- * Removed the unneeded QuickTag checkbox from the settings screen for snippets,
105
- as all snippets are now always available from the HTML editor's QuickTag
106
- button.
107
-
108
- = Version 1.8.7 - 25 Dec 2011 =
109
- * Updated the TinyMCE plugin for the Post Snippets button in WordPress Visual
110
- Editor to use the same jQuery UI Dialog window that the HTML button have had
111
- for some time. The consolidation of using the same window and code for the
112
- different buttons will make Post Snippets easier to maintain and update.
113
- * Added an admin notice when running on PHP versions below 5.2.4 to prepare
114
- users that future Post Snippets requirements will be on par with WordPress
115
- 3.3.
116
-
117
- = Version 1.8.6 - 15 Dec 2011 =
118
- * The Post Snippets HTML editor button is updated to be compatible with
119
- WordPress 3.3 refactored QuickTags.
120
-
121
- = Version 1.8.5 - 22 Nov 2011 =
122
- * Included German translation by Brian Flores.
123
- * For all translators: Updated the .pot file to include all the latest strings
124
- and changes.
125
-
126
- = Version 1.8.4 - 10 Nov 2011 =
127
- * Included Belarusian translation by Alexander Ovsov.
128
-
129
- = Version 1.8.3 - 13 Oct 2011 =
130
- * Included Hebrew translation by Sagive.
131
-
132
- = Version 1.8.2 - 3 Sep 2011 =
133
- * Added support for using enclosed shortcodes with the snippets. Use the
134
- variable {content} in your snippets to retrieve the enclosed content.
135
- * Updated the dropdown help text.
136
- * Included Lithuanian translation by Nata Strazda.
137
-
138
- = Version 1.8.1 - 11 Jul 2011 =
139
- * Fixed that a PHP warning is thrown when other scripts called the
140
- get_post_snippet() function without supplying a second argument.
141
-
142
- = Version 1.8 - 30 May 2011 =
143
- * Fixed an escaping problem with the snippet description.
144
- * Added Import / Export functionality.
145
- * Snippets used as shortcodes can now nest other shortcodes in them.
146
-
147
- = Version 1.7.3 - 3 Mar 2011 =
148
- * Added a text area field in the settings panel to enter an optional
149
- description for each snippet. This decription is displayed for the editor
150
- writing a post in the jQuery Post Snippet dialog.
151
- * Fixed the styling of the quicktag jQuery window when the user have disabled
152
- the visual editor completely.
153
- * Fixed problem with line formatting in the new quicktag snippets.
154
- * Fixed a problem with JavaScript snippets breaking the admin page.
155
- * Various small bugfixes.
156
-
157
- = Version 1.7.2 - 28 Feb 2011 =
158
- * Specified text/javascript for the UI dialog script.
159
- * Updated the Spanish translation by Melvis E. Leon Lopez.
160
-
161
- = Version 1.7.1 - 26 Feb 2011 =
162
- * Added styling to the Tabs in the Quicktag jQuery dialog window to make them
163
- more "tab-like".
164
- * Added the possibility to use a description for each snippet to display for
165
- the user when opening the Quicktag jQuery dialog window. Snippets without
166
- description and variables, has a default information message.
167
- * Moved the help text from below the snippets to the contextual help dropdown
168
- menu at the top of the settings page.
169
- * **Changed the required version of WordPress to 3.0**.
170
- * Request by proximity2008: A snippet without anything entered in the snippet
171
- field will not be registered as a shortcode.
172
-
173
- = Version 1.7 - 26 Feb 2011 =
174
- * Complete rewrite of the QuickTags insert functionality. It now uses jQuery UI
175
- to display a similar tabbed window as the TinyMCE button does. There is now
176
- one 'Post Snippets' button in the HTML editor instead of a separate button
177
- for each snippet. As the QuickTags function is completely rewritten, and this
178
- is the initial release of the new method, please report if you encounter any
179
- problems with it.
180
- * Fixed QuickTags compability with WordPress 3.1.
181
- * Added a link to the Post Snippets Settings directly from the entry on the
182
- 'Plugins List' page.
183
- * Added get_post_snippet() function to retrieve snippets directly from PHP.
184
-
185
- = Version 1.5.4 - 26 Jan 2011 =
186
- * Included Turkish translation by Ersan Özdil.
187
-
188
- = Version 1.5.3 - 19 Sep 2010 =
189
- * Included Spanish translation by Melvis E. Leon Lopez.
190
-
191
- = Version 1.5.2 - 17 Sep 2010 =
192
- * The plugin now keeps linefeed formatting when inserting a snippet directly
193
- with a quicktag in the HTML editor.
194
- * Updated the code to not generate warnings when running WordPress in debug
195
- mode.
196
-
197
- = Version 1.5.1 - 12 Mar 2010 =
198
- * Fixed ampersands when used in a shortcode, so they are XHTML valid.
199
-
200
- = Version 1.5 - 12 Jan 2010 =
201
- * Updated the plugin so it works with WordPress 2.9.x (the quicktags didn't
202
- work in 2.9, now fixed.).
203
-
204
- = Version 1.4.9.1 - 5 Sep 2009 =
205
- * Included French translation by Thomas Cailhe (Oyabi).
206
-
207
- = Version 1.4.9 - 10 Aug 2009 =
208
- * Included Russian translation by FatCow.
209
-
210
- = Version 1.4.8 - 9 May 2009 =
211
- * Changed the handling of the TinyMCE button as some server configurations had
212
- problems finding the correct path.
213
- * Fixed a problem that didn't let a snippet contain a </script> tag.
214
-
215
- = Version 1.4.7 - 27 Apr 2009 =
216
- * Added a workaround for a bug in WordPress 2.7.x wp-includes/compat.php that
217
- prevented the plugin to work correctly on webservers running with PHP below
218
- version 5.1.0 together with WP 2.7.x. This bug is patched in WordPress 2.8.
219
-
220
- = Version 1.4.6 - 25 Apr 2009 =
221
- * Updated all code to follow the WordPress Coding Standards for consistency, if
222
- someone wants to modify my code.
223
- * Removed the nodechangehandler from the TinyMCE js, as it didn't fill any
224
- purpose.
225
- * Updated the save code to remove the PHP Notice messages, if using error
226
- logging on the server.
227
- * Added additional proofing for the variables string.
228
-
229
- = Version 1.4.5 - 24 Apr 2009 =
230
- * Fixed a problem in the admin options that didn't allow a form with a textarea
231
- to be used as a snippet.
232
- * Widened the columns for SC and QT slightly in the options panel so they
233
- should look a bit better on the mac.
234
-
235
- = Version 1.4.4 - 19 Apr 2009 =
236
- * Minor fix with quicktags and certain snippets that was left out in the last
237
- update.
238
-
239
- = Version 1.4.3 - 16 Apr 2009 =
240
- * Fixed an escaping problem with the recently implemented shortcode function,
241
- that could cause problems on certain strings.
242
- * Fixed an escaping problem with the quicktag javascript, that could cause
243
- problems on certain strings.
244
-
245
- = Version 1.4.2 - 11 Apr 2009 =
246
- * Fixed some additional syntax for servers where the short_open_tag
247
- configuration setting is disabled.
248
-
249
- = Version 1.4.1 - 10 Apr 2009 =
250
- * Removed all short syntax commands and replaced them with the full versions so
251
- the plugin also works on servers with the short_open_tag configuration
252
- setting disabled.
253
-
254
- = Version 1.4 - 10 Apr 2009 =
255
- * Added a checkbox for Shortcodes (SC) in the admin panel. When checking this
256
- one a dynamic shortcode will be generated and inserted instead of the
257
- snippet, which allows snippets to be updated later on for all posts it's been
258
- inserted into when using this option.
259
- * Added a checkbox for Quicktags (QT) in the admin panel, so Quicktags are
260
- optional. Speeds up loading of the post editor if you don't need the quicktag
261
- support, and only use the visual editor. Defaults to off.
262
-
263
- = Version 1.3.5 - 9 Apr 2009 =
264
- * Fixed so the TinyMCE window adds a scrollbar if there is more variables for a
265
- snippet than fits in the window.
266
- * Fixed a bug that snippets didn't get inserted when using the visual editor in
267
- fullscreen mode.
268
-
269
- = Version 1.3 - 2 Apr 2009 =
270
- * Fixed a problem with the regular expressions that prohibited variables
271
- consisting of just a single number to work.
272
- * Updated the Help info in the admin page to take less space.
273
- * Included a check so the plugin only runs in WP 2.7 or newer.
274
-
275
- = Version 1.2 - 1 Apr 2009 =
276
- * Added support for Quicktags so the snippets can be made available in the HTML
277
- editor as well.
278
-
279
- = Version 1.1 - 24 Mar 2009 =
280
- * Included Swedish translation.
281
- * Added TextDomain functionality for I18n.
282
-
283
- = Version 1.0 - 23 Mar 2009 =
284
- * Initial Release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Post Snippets ===
2
+ Contributors: artstorm
3
+ Donate link: http://wpstorm.net/wordpress-plugins/post-snippets/#donation
4
+ Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php
5
+ Requires at least: 3.0
6
+ Tested up to: 3.3.1
7
+ Stable tag: 1.9
8
+
9
+ Keep a snippet library of text, HTML or PHP code to be used in posts. Variables
10
+ can be set for more flexibility. Inserts directly or as shortcodes.
11
+
12
+ == Description ==
13
+
14
+ This admin plugin stores snippets of HTML code or reoccurring text that you
15
+ often use in your posts. You can use predefined variables to replace parts of
16
+ the snippet on insert. All snippets are available in the post editor with a
17
+ TinyMCE button. The snippet can be inserted as defined, or as a shortcode to
18
+ keep flexibility for updating the snippet. Also PHP code is supported for
19
+ snippets inserted as shortcodes.
20
+
21
+ = Features =
22
+
23
+ * **Insert** All defined snippets is inserted from a button directly in the post
24
+ editor.
25
+ * **Shortcodes** You can use this plugin to create your own shortcodes.
26
+ * **PHP** A shortcode snippet can optionally be evaluated as PHP code.
27
+ * **Buttons** The snippets are available in the viusal editor with a TinyMCE
28
+ button and in the HTML editor with a quicktag button.
29
+ * **Admin** Easy to use administration panel where you can add, edit and remove
30
+ snippets.
31
+ * **Variables** Each snippet can have as many custom variables as you like,
32
+ which can be used on insert.
33
+ * **Import/Export** Snippets can be imported and exported between sites.
34
+ * **Uninstall** If you delete the plugin from your plugins panel it cleans up
35
+ all data it has created in the Wordpress database.
36
+
37
+ = Related Links =
38
+
39
+ * [Documentation](http://wpstorm.net/wordpress-plugins/post-snippets/
40
+ "Complete usage instructions")
41
+ * [Support Forum](http://wordpress.org/tags/post-snippets?forum_id=10
42
+ "Use this for support and feature requests")
43
+
44
+ See the [Changelog](http://wordpress.org/extend/plugins/post-snippets/changelog/) for what's new. Available [Translations](http://wpstorm.net/wordpress-plugins/post-snippets/#translations).
45
+
46
+
47
+ == Installation ==
48
+
49
+ = Requirements =
50
+
51
+ * PHP version 5.2.4 or greater.
52
+ * WordPress version 3.0 or greater.
53
+
54
+ = Install =
55
+
56
+ 1. Upload the 'post-snippets' folder to the '/wp-content/plugins/' directory.
57
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
58
+ 3. Go to Settings -> Post Snippets and start entering your snippets.
59
+
60
+ = Uninstall =
61
+
62
+ 1. Deactivate Post Snippets in the 'Plugins' menu in Wordpress.
63
+ 2. Select Post Snippets in the 'Recently Active Plugins' section and select
64
+ 'Delete' from the 'Bulk Actions' drop down menu.
65
+ 3. This will delete all the plugin files from the server as well as erasing all
66
+ options the plugin has stored in the database.
67
+
68
+ == Frequently Asked Questions ==
69
+
70
+ = Why do importing Snippets on a multi site install fail? =
71
+
72
+ Upload of zip files must be allowed, enable this in Sites Network Admin -> Settings -> Upload Settings -> Upload file types.
73
+
74
+ = How can I use the content in an enclosed shortcode? =
75
+
76
+ If the shortcode is enclosed and contains content between the tags in a post.
77
+ Example: `[shortcode]Some text[/shortcode]` the text within will be availble in
78
+ a variable called content. So in your snippet use {content} to display it. Don't
79
+ enter 'content' in the variable field, it's automatically assigned.
80
+
81
+ = Where can I get support? =
82
+
83
+ Please visit the [Support Forum](http://wordpress.org/tags/post-snippets?forum_id=10 "Use this for support and feature requests")
84
+ for questions, answers, support and feature requests.
85
+
86
+ == Screenshots ==
87
+
88
+ 1. The Admin page where you set up new snippets.
89
+ 2. The TinyMCE button for Post Snippets.
90
+ 3. The Post Snippet Insert Window.
91
+
92
+ == Changelog ==
93
+
94
+ = Version 1.9 - 17 Jan 2012 =
95
+ * Initial implementation to allow snippets to be evaluated as PHP code.
96
+ [Read more](http://wpstorm.net/wordpress-plugins/post-snippets/#php).
97
+ * PHP version 5.2.4 or greater is now required to run Post Snippets.
98
+
99
+ = Version 1.8.9.2 - 15 Jan 2012 =
100
+ * Added an additional check to see if Post Snippets is loaded via a
101
+ bootstrapped WP Admin that doesn't set the is_admin() flag, so it works in
102
+ that environment as well.
103
+
104
+ = Version 1.8.9.1 - 11 Jan 2012 =
105
+ * A bug fixed with get_post_snippets() that were introduced in the last update.
106
+ * Unit test for get_post_snippets() added to automate testing that it won't
107
+ break in future updates.
108
+
109
+ = Version 1.8.9 - 10 Jan 2012 =
110
+ * Updated the help text to take advantage of the new Help API introduced with
111
+ WordPress 3.3.
112
+ * Updated the Swedish translation.
113
+
114
+ = Version 1.8.8 - 28 Dec 2011 =
115
+ * Removed the unneeded QuickTag checkbox from the settings screen for snippets,
116
+ as all snippets are now always available from the HTML editor's QuickTag
117
+ button.
118
+
119
+ = Version 1.8.7 - 25 Dec 2011 =
120
+ * Updated the TinyMCE plugin for the Post Snippets button in WordPress Visual
121
+ Editor to use the same jQuery UI Dialog window that the HTML button have had
122
+ for some time. The consolidation of using the same window and code for the
123
+ different buttons will make Post Snippets easier to maintain and update.
124
+ * Added an admin notice when running on PHP versions below 5.2.4 to prepare
125
+ users that future Post Snippets requirements will be on par with WordPress
126
+ 3.3.
127
+
128
+ = Version 1.8.6 - 15 Dec 2011 =
129
+ * The Post Snippets HTML editor button is updated to be compatible with
130
+ WordPress 3.3 refactored QuickTags.
131
+
132
+ = Version 1.8.5 - 22 Nov 2011 =
133
+ * Included German translation by Brian Flores.
134
+ * For all translators: Updated the .pot file to include all the latest strings
135
+ and changes.
136
+
137
+ = Version 1.8.4 - 10 Nov 2011 =
138
+ * Included Belarusian translation by Alexander Ovsov.
139
+
140
+ = Version 1.8.3 - 13 Oct 2011 =
141
+ * Included Hebrew translation by Sagive.
142
+
143
+ = Version 1.8.2 - 3 Sep 2011 =
144
+ * Added support for using enclosed shortcodes with the snippets. Use the
145
+ variable {content} in your snippets to retrieve the enclosed content.
146
+ * Updated the dropdown help text.
147
+ * Included Lithuanian translation by Nata Strazda.
148
+
149
+ = Version 1.8.1 - 11 Jul 2011 =
150
+ * Fixed that a PHP warning is thrown when other scripts called the
151
+ get_post_snippet() function without supplying a second argument.
152
+
153
+ = Version 1.8 - 30 May 2011 =
154
+ * Fixed an escaping problem with the snippet description.
155
+ * Added Import / Export functionality.
156
+ * Snippets used as shortcodes can now nest other shortcodes in them.
157
+
158
+ = Version 1.7.3 - 3 Mar 2011 =
159
+ * Added a text area field in the settings panel to enter an optional
160
+ description for each snippet. This decription is displayed for the editor
161
+ writing a post in the jQuery Post Snippet dialog.
162
+ * Fixed the styling of the quicktag jQuery window when the user have disabled
163
+ the visual editor completely.
164
+ * Fixed problem with line formatting in the new quicktag snippets.
165
+ * Fixed a problem with JavaScript snippets breaking the admin page.
166
+ * Various small bugfixes.
167
+
168
+ = Version 1.7.2 - 28 Feb 2011 =
169
+ * Specified text/javascript for the UI dialog script.
170
+ * Updated the Spanish translation by Melvis E. Leon Lopez.
171
+
172
+ = Version 1.7.1 - 26 Feb 2011 =
173
+ * Added styling to the Tabs in the Quicktag jQuery dialog window to make them
174
+ more "tab-like".
175
+ * Added the possibility to use a description for each snippet to display for
176
+ the user when opening the Quicktag jQuery dialog window. Snippets without
177
+ description and variables, has a default information message.
178
+ * Moved the help text from below the snippets to the contextual help dropdown
179
+ menu at the top of the settings page.
180
+ * **Changed the required version of WordPress to 3.0**.
181
+ * Request by proximity2008: A snippet without anything entered in the snippet
182
+ field will not be registered as a shortcode.
183
+
184
+ = Version 1.7 - 26 Feb 2011 =
185
+ * Complete rewrite of the QuickTags insert functionality. It now uses jQuery UI
186
+ to display a similar tabbed window as the TinyMCE button does. There is now
187
+ one 'Post Snippets' button in the HTML editor instead of a separate button
188
+ for each snippet. As the QuickTags function is completely rewritten, and this
189
+ is the initial release of the new method, please report if you encounter any
190
+ problems with it.
191
+ * Fixed QuickTags compability with WordPress 3.1.
192
+ * Added a link to the Post Snippets Settings directly from the entry on the
193
+ 'Plugins List' page.
194
+ * Added get_post_snippet() function to retrieve snippets directly from PHP.
195
+
196
+ = Version 1.5.4 - 26 Jan 2011 =
197
+ * Included Turkish translation by Ersan Özdil.
198
+
199
+ = Version 1.5.3 - 19 Sep 2010 =
200
+ * Included Spanish translation by Melvis E. Leon Lopez.
201
+
202
+ = Version 1.5.2 - 17 Sep 2010 =
203
+ * The plugin now keeps linefeed formatting when inserting a snippet directly
204
+ with a quicktag in the HTML editor.
205
+ * Updated the code to not generate warnings when running WordPress in debug
206
+ mode.
207
+
208
+ = Version 1.5.1 - 12 Mar 2010 =
209
+ * Fixed ampersands when used in a shortcode, so they are XHTML valid.
210
+
211
+ = Version 1.5 - 12 Jan 2010 =
212
+ * Updated the plugin so it works with WordPress 2.9.x (the quicktags didn't
213
+ work in 2.9, now fixed.).
214
+
215
+ = Version 1.4.9.1 - 5 Sep 2009 =
216
+ * Included French translation by Thomas Cailhe (Oyabi).
217
+
218
+ = Version 1.4.9 - 10 Aug 2009 =
219
+ * Included Russian translation by FatCow.
220
+
221
+ = Version 1.4.8 - 9 May 2009 =
222
+ * Changed the handling of the TinyMCE button as some server configurations had
223
+ problems finding the correct path.
224
+ * Fixed a problem that didn't let a snippet contain a </script> tag.
225
+
226
+ = Version 1.4.7 - 27 Apr 2009 =
227
+ * Added a workaround for a bug in WordPress 2.7.x wp-includes/compat.php that
228
+ prevented the plugin to work correctly on webservers running with PHP below
229
+ version 5.1.0 together with WP 2.7.x. This bug is patched in WordPress 2.8.
230
+
231
+ = Version 1.4.6 - 25 Apr 2009 =
232
+ * Updated all code to follow the WordPress Coding Standards for consistency, if
233
+ someone wants to modify my code.
234
+ * Removed the nodechangehandler from the TinyMCE js, as it didn't fill any
235
+ purpose.
236
+ * Updated the save code to remove the PHP Notice messages, if using error
237
+ logging on the server.
238
+ * Added additional proofing for the variables string.
239
+
240
+ = Version 1.4.5 - 24 Apr 2009 =
241
+ * Fixed a problem in the admin options that didn't allow a form with a textarea
242
+ to be used as a snippet.
243
+ * Widened the columns for SC and QT slightly in the options panel so they
244
+ should look a bit better on the mac.
245
+
246
+ = Version 1.4.4 - 19 Apr 2009 =
247
+ * Minor fix with quicktags and certain snippets that was left out in the last
248
+ update.
249
+
250
+ = Version 1.4.3 - 16 Apr 2009 =
251
+ * Fixed an escaping problem with the recently implemented shortcode function,
252
+ that could cause problems on certain strings.
253
+ * Fixed an escaping problem with the quicktag javascript, that could cause
254
+ problems on certain strings.
255
+
256
+ = Version 1.4.2 - 11 Apr 2009 =
257
+ * Fixed some additional syntax for servers where the short_open_tag
258
+ configuration setting is disabled.
259
+
260
+ = Version 1.4.1 - 10 Apr 2009 =
261
+ * Removed all short syntax commands and replaced them with the full versions so
262
+ the plugin also works on servers with the short_open_tag configuration
263
+ setting disabled.
264
+
265
+ = Version 1.4 - 10 Apr 2009 =
266
+ * Added a checkbox for Shortcodes (SC) in the admin panel. When checking this
267
+ one a dynamic shortcode will be generated and inserted instead of the
268
+ snippet, which allows snippets to be updated later on for all posts it's been
269
+ inserted into when using this option.
270
+ * Added a checkbox for Quicktags (QT) in the admin panel, so Quicktags are
271
+ optional. Speeds up loading of the post editor if you don't need the quicktag
272
+ support, and only use the visual editor. Defaults to off.
273
+
274
+ = Version 1.3.5 - 9 Apr 2009 =
275
+ * Fixed so the TinyMCE window adds a scrollbar if there is more variables for a
276
+ snippet than fits in the window.
277
+ * Fixed a bug that snippets didn't get inserted when using the visual editor in
278
+ fullscreen mode.
279
+
280
+ = Version 1.3 - 2 Apr 2009 =
281
+ * Fixed a problem with the regular expressions that prohibited variables
282
+ consisting of just a single number to work.
283
+ * Updated the Help info in the admin page to take less space.
284
+ * Included a check so the plugin only runs in WP 2.7 or newer.
285
+
286
+ = Version 1.2 - 1 Apr 2009 =
287
+ * Added support for Quicktags so the snippets can be made available in the HTML
288
+ editor as well.
289
+
290
+ = Version 1.1 - 24 Mar 2009 =
291
+ * Included Swedish translation.
292
+ * Added TextDomain functionality for I18n.
293
+
294
+ = Version 1.0 - 23 Mar 2009 =
295
+ * Initial Release
296
+
297
+ == Upgrade Notice ==
298
+
299
+ = 1.9 =
300
+ Note that starting with this version and moving forward, at least PHP v5.2.4 is
301
+ required to run Post Snippets.