Post Snippets - Version 2.3.9

Version Description

Download this release

Release Info

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

Code changes from version 2.3.8 to 2.3.9

lang/post-snippets-ro_RO.po CHANGED
@@ -255,8 +255,8 @@ msgid "Post Snippets"
255
  msgstr "Fragmente post"
256
 
257
  #. Plugin URI of the plugin/theme
258
- msgid "http://wpstorm.net/wordpress-plugins/post-snippets/"
259
- msgstr "http://wpstorm.net/Wordpress-plugins/post-Snippets/"
260
 
261
  #. Description of the plugin/theme
262
  msgid "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."
@@ -267,6 +267,6 @@ msgid "Johan Steen"
267
  msgstr "Johan Steen"
268
 
269
  #. Author URI of the plugin/theme
270
- msgid "http://johansteen.se/"
271
- msgstr "http://johansteen.se/"
272
 
255
  msgstr "Fragmente post"
256
 
257
  #. Plugin URI of the plugin/theme
258
+ msgid "https://johansteen.se/code/post-snippets/"
259
+ msgstr "https://johansteen.se/code/post-snippets/"
260
 
261
  #. Description of the plugin/theme
262
  msgid "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."
267
  msgstr "Johan Steen"
268
 
269
  #. Author URI of the plugin/theme
270
+ msgid "https://johansteen.se/"
271
+ msgstr "https://johansteen.se/"
272
 
lang/post-snippets-sk_SK.po CHANGED
@@ -327,8 +327,8 @@ msgid "Post Snippets"
327
  msgstr "Príspevok úryvky"
328
 
329
  #. Plugin URI of the plugin/theme
330
- msgid "http://wpstorm.net/wordpress-plugins/post-snippets/"
331
- msgstr "http://wpstorm.net/Wordpress-plugins/post-snippets/"
332
 
333
  #. Description of the plugin/theme
334
  msgid ""
@@ -345,5 +345,5 @@ msgid "Johan Steen"
345
  msgstr "Johan Steen"
346
 
347
  #. Author URI of the plugin/theme
348
- msgid "http://johansteen.se/"
349
- msgstr "http://johansteen.se/"
327
  msgstr "Príspevok úryvky"
328
 
329
  #. Plugin URI of the plugin/theme
330
+ msgid "https://johansteen.se/code/post-snippets/"
331
+ msgstr "https://johansteen.se/code/post-snippets/"
332
 
333
  #. Description of the plugin/theme
334
  msgid ""
345
  msgstr "Johan Steen"
346
 
347
  #. Author URI of the plugin/theme
348
+ msgid "https://johansteen.se/"
349
+ msgstr "https://johansteen.se/"
lang/post-snippets-sr_RS.po CHANGED
@@ -328,8 +328,8 @@ msgid "Post Snippets"
328
  msgstr "Post Snippets"
329
 
330
  #. Plugin URI of the plugin/theme
331
- msgid "http://wpstorm.net/wordpress-plugins/post-snippets/"
332
- msgstr "http://wpstorm.net/wordpress-plugins/post-snippets/"
333
 
334
  #. Description of the plugin/theme
335
  msgid ""
@@ -347,5 +347,5 @@ msgid "Johan Steen"
347
  msgstr "Johan Steen"
348
 
349
  #. Author URI of the plugin/theme
350
- msgid "http://johansteen.se/"
351
- msgstr "http://johansteen.se/"
328
  msgstr "Post Snippets"
329
 
330
  #. Plugin URI of the plugin/theme
331
+ msgid "https://johansteen.se/code/post-snippets/"
332
+ msgstr "https://johansteen.se/code/post-snippets/"
333
 
334
  #. Description of the plugin/theme
335
  msgid ""
347
  msgstr "Johan Steen"
348
 
349
  #. Author URI of the plugin/theme
350
+ msgid "https://johansteen.se/"
351
+ msgstr "https://johansteen.se/"
post-snippets.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: Post Snippets
4
- 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.8
9
  License: GPLv2 or later
10
  Text Domain: post-snippets
11
  Domain Path: /lang
@@ -34,7 +34,7 @@ spl_autoload_register('PostSnippets::autoload');
34
  * Init Singleton Class.
35
  *
36
  * @author Johan Steen <artstorm at gmail dot com>
37
- * @link http://johansteen.se/
38
  */
39
  class PostSnippets
40
  {
1
  <?php
2
  /*
3
  Plugin Name: Post Snippets
4
+ Plugin URI: https://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: https://johansteen.se/
8
+ Version: 2.3.9
9
  License: GPLv2 or later
10
  Text Domain: post-snippets
11
  Domain Path: /lang
34
  * Init Singleton Class.
35
  *
36
  * @author Johan Steen <artstorm at gmail dot com>
37
+ * @link https://johansteen.se/
38
  */
39
  class PostSnippets
40
  {
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Post Snippets ===
2
  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: 4.4
7
- Stable tag: 2.3.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -40,7 +40,7 @@ updating the snippet. PHP code is supported for snippets inserted as shortcodes.
40
 
41
  = Related Links =
42
 
43
- * [Plugin Page](http://johansteen.se/code/post-snippets/
44
  "Post snippets plugin page")
45
  * [Support Forum](http://wordpress.org/support/plugin/post-snippets
46
  "Use this for support and feature requests")
@@ -128,6 +128,11 @@ Contributions are appreciated and encouraged.
128
 
129
  == Changelog ==
130
 
 
 
 
 
 
131
  = Version 2.3.8 - 10 Dec 2015 =
132
  * Adds validation of shortcode names. Invalid shortcode names now gets
133
  highlighted in red.
@@ -239,7 +244,6 @@ Contributions are appreciated and encouraged.
239
 
240
  = Version 1.9.6 - 19 Mar 2012 =
241
  * Added two new filters. `post_snippets_import` and `post_snippets_export`.
242
- [Read more](http://wpstorm.net/wordpress-plugins/post-snippets/#filters).
243
 
244
  = Version 1.9.5 - 17 Mar 2012 =
245
  * The HTML and scripts for the popup window in the post editor is now only
@@ -264,7 +268,6 @@ Contributions are appreciated and encouraged.
264
 
265
  = Version 1.9 - 17 Jan 2012 =
266
  * Initial implementation to allow snippets to be evaluated as PHP code.
267
- [Read more](http://wpstorm.net/wordpress-plugins/post-snippets/#php).
268
  * PHP version 5.2.4 or greater is now required to run Post Snippets.
269
 
270
  = Version 1.8.9.2 - 15 Jan 2012 =
1
  === Post Snippets ===
2
  Contributors: artstorm
3
+ Donate link: https://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: 4.4
7
+ Stable tag: 2.3.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
40
 
41
  = Related Links =
42
 
43
+ * [Plugin Page](https://johansteen.se/code/post-snippets/
44
  "Post snippets plugin page")
45
  * [Support Forum](http://wordpress.org/support/plugin/post-snippets
46
  "Use this for support and feature requests")
128
 
129
  == Changelog ==
130
 
131
+ = Version 2.3.9 - 14 Dec 2015 =
132
+ * Only includes the javascript code to include Post Snippets in WordPress'
133
+ editor on post editing related screens, to avoid potential condlicts with
134
+ other plugins.
135
+
136
  = Version 2.3.8 - 10 Dec 2015 =
137
  * Adds validation of shortcode names. Invalid shortcode names now gets
138
  highlighted in red.
244
 
245
  = Version 1.9.6 - 19 Mar 2012 =
246
  * Added two new filters. `post_snippets_import` and `post_snippets_export`.
 
247
 
248
  = Version 1.9.5 - 17 Mar 2012 =
249
  * The HTML and scripts for the popup window in the post editor is now only
268
 
269
  = Version 1.9 - 17 Jan 2012 =
270
  * Initial implementation to allow snippets to be evaluated as PHP code.
 
271
  * PHP version 5.2.4 or greater is now required to run Post Snippets.
272
 
273
  = Version 1.8.9.2 - 15 Jan 2012 =
src/PostSnippets/Admin.php CHANGED
@@ -6,7 +6,7 @@
6
  * methods to simply the maintainance of the admin screen.
7
  *
8
  * @author Johan Steen <artstorm at gmail dot com>
9
- * @link http://johansteen.se/
10
  */
11
  class PostSnippets_Admin
12
  {
6
  * methods to simply the maintainance of the admin screen.
7
  *
8
  * @author Johan Steen <artstorm at gmail dot com>
9
+ * @link https://johansteen.se/
10
  */
11
  class PostSnippets_Admin
12
  {
src/PostSnippets/Help.php CHANGED
@@ -3,7 +3,7 @@
3
  * Handles the plugin help screen.
4
  *
5
  * @author Johan Steen <artstorm at gmail dot com>
6
- * @link http://johansteen.se/
7
  */
8
  class PostSnippets_Help
9
  {
3
  * Handles the plugin help screen.
4
  *
5
  * @author Johan Steen <artstorm at gmail dot com>
6
+ * @link https://johansteen.se/
7
  */
8
  class PostSnippets_Help
9
  {
src/PostSnippets/ImportExport.php CHANGED
@@ -5,7 +5,7 @@
5
  * Class to handle import and export of Snippets.
6
  *
7
  * @author Johan Steen <artstorm at gmail dot com>
8
- * @link http://johansteen.se/
9
  */
10
  class PostSnippets_ImportExport
11
  {
5
  * Class to handle import and export of Snippets.
6
  *
7
  * @author Johan Steen <artstorm at gmail dot com>
8
+ * @link https://johansteen.se/
9
  */
10
  class PostSnippets_ImportExport
11
  {
src/PostSnippets/Shortcode.php CHANGED
@@ -3,7 +3,7 @@
3
  * Shortcode Handling.
4
  *
5
  * @author Johan Steen <artstorm at gmail dot com>
6
- * @link http://johansteen.se/
7
  */
8
  class PostSnippets_Shortcode
9
  {
@@ -39,13 +39,13 @@ class PostSnippets_Shortcode
39
  '$atts,$content=null',
40
  '$shortcode_symbols = array('.$vars_str.');
41
  extract(shortcode_atts($shortcode_symbols, $atts));
42
-
43
  $attributes = compact( array_keys($shortcode_symbols) );
44
-
45
  // Add enclosed content if available to the attributes array
46
  if ( $content != null )
47
  $attributes["content"] = $content;
48
-
49
 
50
  $snippet = \''. addslashes($snippet["snippet"]) .'\';
51
  // Disables auto conversion from & to &amp; as that should be done in snippet, not code (destroys php etc).
3
  * Shortcode Handling.
4
  *
5
  * @author Johan Steen <artstorm at gmail dot com>
6
+ * @link https://johansteen.se/
7
  */
8
  class PostSnippets_Shortcode
9
  {
39
  '$atts,$content=null',
40
  '$shortcode_symbols = array('.$vars_str.');
41
  extract(shortcode_atts($shortcode_symbols, $atts));
42
+
43
  $attributes = compact( array_keys($shortcode_symbols) );
44
+
45
  // Add enclosed content if available to the attributes array
46
  if ( $content != null )
47
  $attributes["content"] = $content;
48
+
49
 
50
  $snippet = \''. addslashes($snippet["snippet"]) .'\';
51
  // Disables auto conversion from & to &amp; as that should be done in snippet, not code (destroys php etc).
src/PostSnippets/View.php CHANGED
@@ -3,7 +3,7 @@
3
  * View Handling.
4
  *
5
  * @author Johan Steen <artstorm at gmail dot com>
6
- * @link http://johansteen.se/
7
  */
8
  class PostSnippets_View
9
  {
3
  * View Handling.
4
  *
5
  * @author Johan Steen <artstorm at gmail dot com>
6
+ * @link https://johansteen.se/
7
  */
8
  class PostSnippets_View
9
  {
src/PostSnippets/WPEditor.php CHANGED
@@ -3,7 +3,7 @@
3
  * Post Snippets WP Editor.
4
  *
5
  * @author Johan Steen <artstorm at gmail dot com>
6
- * @link http://johansteen.se/
7
  */
8
  class PostSnippets_WPEditor
9
  {
@@ -79,6 +79,10 @@ class PostSnippets_WPEditor
79
  */
80
  public function registerTinymceButton($buttons)
81
  {
 
 
 
 
82
  array_push($buttons, 'separator', self::TINYMCE_PLUGIN_NAME);
83
  return $buttons;
84
  }
@@ -115,6 +119,10 @@ class PostSnippets_WPEditor
115
  */
116
  public function addQuicktagButton()
117
  {
 
 
 
 
118
  echo "\n<!-- START: Add QuickTag button for Post Snippets -->\n";
119
  ?>
120
  <script type="text/javascript" charset="utf-8">
@@ -159,6 +167,10 @@ class PostSnippets_WPEditor
159
  */
160
  public function jqueryUiDialog()
161
  {
 
 
 
 
162
  echo "\n<!-- START: Post Snippets jQuery UI and related functions -->\n";
163
  echo "<script type='text/javascript'>\n";
164
 
@@ -309,6 +321,10 @@ class PostSnippets_WPEditor
309
  */
310
  public function addJqueryUiDialog()
311
  {
 
 
 
 
312
  $snippets = get_option(PostSnippets::OPTION_KEY, array());
313
 
314
  //Let other plugins change the snippets array
@@ -318,6 +334,18 @@ class PostSnippets_WPEditor
318
  echo PostSnippets_View::render('jquery-ui-dialog', $data);
319
  }
320
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  /**
322
  * Strip Default Value.
323
  *
3
  * Post Snippets WP Editor.
4
  *
5
  * @author Johan Steen <artstorm at gmail dot com>
6
+ * @link https://johansteen.se/
7
  */
8
  class PostSnippets_WPEditor
9
  {
79
  */
80
  public function registerTinymceButton($buttons)
81
  {
82
+ if (!$this->isEditingPost()) {
83
+ return;
84
+ }
85
+
86
  array_push($buttons, 'separator', self::TINYMCE_PLUGIN_NAME);
87
  return $buttons;
88
  }
119
  */
120
  public function addQuicktagButton()
121
  {
122
+ if (!$this->isEditingPost()) {
123
+ return;
124
+ }
125
+
126
  echo "\n<!-- START: Add QuickTag button for Post Snippets -->\n";
127
  ?>
128
  <script type="text/javascript" charset="utf-8">
167
  */
168
  public function jqueryUiDialog()
169
  {
170
+ if (!$this->isEditingPost()) {
171
+ return;
172
+ }
173
+
174
  echo "\n<!-- START: Post Snippets jQuery UI and related functions -->\n";
175
  echo "<script type='text/javascript'>\n";
176
 
321
  */
322
  public function addJqueryUiDialog()
323
  {
324
+ if (!$this->isEditingPost()) {
325
+ return;
326
+ }
327
+
328
  $snippets = get_option(PostSnippets::OPTION_KEY, array());
329
 
330
  //Let other plugins change the snippets array
334
  echo PostSnippets_View::render('jquery-ui-dialog', $data);
335
  }
336
 
337
+ /**
338
+ * Determine if current screen is a post editing screen.
339
+ *
340
+ * @return boolean
341
+ */
342
+ protected function isEditingPost()
343
+ {
344
+ $screen = get_current_screen();
345
+
346
+ return $screen->base == 'post';
347
+ }
348
+
349
  /**
350
  * Strip Default Value.
351
  *
tinymce/editor_plugin.js CHANGED
@@ -40,8 +40,8 @@
40
  return {
41
  longname : 'Post Snippets',
42
  author : 'Johan Steen',
43
- authorurl : 'http://johansteen.se/',
44
- infourl : 'http://wpstorm.net/wordpress-plugins/post-snippets/',
45
  version : '1.9'
46
  };
47
  }
40
  return {
41
  longname : 'Post Snippets',
42
  author : 'Johan Steen',
43
+ authorurl : 'https://johansteen.se/',
44
+ infourl : 'https://johansteen.se/code/post-snippets/',
45
  version : '1.9'
46
  };
47
  }
views/help/sidebar.php CHANGED
@@ -10,6 +10,6 @@ _e('Support Forums', 'post-snippets');
10
  _e('GitHub Repository', 'post-snippets');
11
  ?></a></p>
12
 
13
- <p><a href="http://johansteen.se/donate/" target="_blank"><?php
14
  _e('Donate', 'post-snippets');
15
  ?></a></p>
10
  _e('GitHub Repository', 'post-snippets');
11
  ?></a></p>
12
 
13
+ <p><a href="https://johansteen.se/donate/" target="_blank"><?php
14
  _e('Donate', 'post-snippets');
15
  ?></a></p>