Post Snippets - Version 2.3.2

Version Description

Download this release

Release Info

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

Code changes from version 2.3.1 to 2.3.2

lang/post-snippets.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2013-06-01 23:06+0700\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2013-08-05 08:54+0700\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
lib/PostSnippets/WPEditor.php CHANGED
@@ -213,8 +213,8 @@ class PostSnippets_WPEditor
213
  }
214
  ?>
215
 
216
- var $tabs = $("#post-snippets-tabs").tabs();
217
-
218
  $(function() {
219
  $( "#post-snippets-dialog" ).dialog({
220
  autoOpen: false,
@@ -225,8 +225,19 @@ class PostSnippets_WPEditor
225
  $( this ).dialog( "close" );
226
  },
227
  "Insert": function() {
228
- $( this ).dialog( "close" );
229
- var selected = $tabs.tabs('option', 'selected');
 
 
 
 
 
 
 
 
 
 
 
230
  <?php
231
  foreach ($snippets as $key => $snippet) {
232
  ?>
@@ -255,9 +266,6 @@ class PostSnippets_WPEditor
255
  if (post_snippets_caller == 'html') {
256
  // HTML editor in WordPress 3.3 and greater
257
  QTags.insertContent(insert_snippet);
258
- } else if (post_snippets_caller == 'html_pre33') {
259
- // HTML editor in WordPress below 3.3.
260
- edInsertContent(post_snippets_canvas, insert_snippet);
261
  } else {
262
  // Visual Editor
263
  post_snippets_canvas.execCommand('mceInsertContent', false, insert_snippet);
213
  }
214
  ?>
215
 
216
+ var tabs = $("#post-snippets-tabs").tabs();
217
+
218
  $(function() {
219
  $( "#post-snippets-dialog" ).dialog({
220
  autoOpen: false,
225
  $( this ).dialog( "close" );
226
  },
227
  "Insert": function() {
228
+ $(this).dialog("close");
229
+ <?php
230
+ global $wp_version;
231
+ if (version_compare($wp_version, '3.5', '<')) {
232
+ ?>
233
+ var selected = tabs.tabs('option', 'selected');
234
+ <?php
235
+ } else {
236
+ ?>
237
+ var selected = tabs.tabs('option', 'active');
238
+ <?php
239
+ }
240
+ ?>
241
  <?php
242
  foreach ($snippets as $key => $snippet) {
243
  ?>
266
  if (post_snippets_caller == 'html') {
267
  // HTML editor in WordPress 3.3 and greater
268
  QTags.insertContent(insert_snippet);
 
 
 
269
  } else {
270
  // Visual Editor
271
  post_snippets_canvas.execCommand('mceInsertContent', false, insert_snippet);
post-snippets.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://johansteen.se/code/post-snippets/
5
  Description: Build a library with snippets of HTML, PHP code or reoccurring text that you often use in your posts. Variables to replace parts of the snippet on insert can be used. The snippets can be inserted as-is or as shortcodes.
6
  Author: Johan Steen
7
  Author URI: http://johansteen.se/
8
- Version: 2.3.1
9
  License: GPLv2 or later
10
  Text Domain: post-snippets
11
 
@@ -37,8 +37,10 @@ spl_autoload_register('PostSnippets::autoload');
37
  */
38
  class PostSnippets
39
  {
 
40
  private static $instance = false;
41
 
 
42
  const MIN_PHP_VERSION = '5.2.4';
43
  const MIN_WP_VERSION = '3.3';
44
  const OPTION_KEY = 'post_snippets_options';
5
  Description: Build a library with snippets of HTML, PHP code or reoccurring text that you often use in your posts. Variables to replace parts of the snippet on insert can be used. The snippets can be inserted as-is or as shortcodes.
6
  Author: Johan Steen
7
  Author URI: http://johansteen.se/
8
+ Version: 2.3.2
9
  License: GPLv2 or later
10
  Text Domain: post-snippets
11
 
37
  */
38
  class PostSnippets
39
  {
40
+ /** Holds the plugin instance */
41
  private static $instance = false;
42
 
43
+ /** Define plugin constants */
44
  const MIN_PHP_VERSION = '5.2.4';
45
  const MIN_WP_VERSION = '3.3';
46
  const OPTION_KEY = 'post_snippets_options';
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: artstorm
3
  Donate link: http://johansteen.se/donate/
4
  Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php, code
5
  Requires at least: 3.3
6
- Tested up to: 3.5.1
7
- Stable tag: 2.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -121,6 +121,12 @@ Contributions are appreciated and encouraged.
121
 
122
  == Changelog ==
123
 
 
 
 
 
 
 
124
  = Version 2.3.1 - 1 Jun 2013 =
125
  * Removes the `$isArray` argument from `PostSnippets::getSnippet()` as it was
126
  not needed.
@@ -130,8 +136,8 @@ Contributions are appreciated and encouraged.
130
  to accept an array with variables and not only a querystring. Fixes
131
  [issue #22](https://github.com/artstorm/post-snippets/issues/22).
132
  * Removes `get_post_snippet()` which was deprecated in version 2.1.
133
- * Adds POST_SNIPPETS_DISABLE_PHP constant for easy disabling the PHP
134
- code execution in snippets. Add
135
  `define('POST_SNIPPETS_DISABLE_PHP', true);`
136
  to wp-config.php or the theme's functions.php to disable PHP execution in the
137
  plugin.
3
  Donate link: http://johansteen.se/donate/
4
  Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php, code
5
  Requires at least: 3.3
6
+ Tested up to: 3.6
7
+ Stable tag: 2.3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
121
 
122
  == Changelog ==
123
 
124
+ = Version 2.3.2 - 5 Aug 2013 =
125
+ * Updates insert snippets into the editor to be compatible with jQuery 1.9+
126
+ (which makes it compatible with WordPress 3.6).
127
+ * Changes WP version check to comply with WordPress 3.3 as the minimum required
128
+ version.
129
+
130
  = Version 2.3.1 - 1 Jun 2013 =
131
  * Removes the `$isArray` argument from `PostSnippets::getSnippet()` as it was
132
  not needed.
136
  to accept an array with variables and not only a querystring. Fixes
137
  [issue #22](https://github.com/artstorm/post-snippets/issues/22).
138
  * Removes `get_post_snippet()` which was deprecated in version 2.1.
139
+ * Adds POST_SNIPPETS_DISABLE_PHP constant to easy disable the PHP code
140
+ execution in snippets. Add
141
  `define('POST_SNIPPETS_DISABLE_PHP', true);`
142
  to wp-config.php or the theme's functions.php to disable PHP execution in the
143
  plugin.