Post Snippets - Version 2.4

Version Description

Download this release

Release Info

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

Code changes from version 2.3.9 to 2.4

post-snippets.php CHANGED
@@ -5,7 +5,7 @@ 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
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.4
9
  License: GPLv2 or later
10
  Text Domain: post-snippets
11
  Domain Path: /lang
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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
 
@@ -128,9 +128,13 @@ Contributions are appreciated and encouraged.
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 =
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.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
128
 
129
  == Changelog ==
130
 
131
+ = Version 2.4 - 18 Dec 2015 =
132
+ * Fixes potential conflict with WP Editor on none post screens.
133
+ * Removes notice message on some screens if WordPress debug mode is enabled.
134
+
135
  = Version 2.3.9 - 14 Dec 2015 =
136
  * Only includes the javascript code to include Post Snippets in WordPress'
137
+ editor on post editing related screens, to avoid potential conflicts with
138
  other plugins.
139
 
140
  = Version 2.3.8 - 10 Dec 2015 =
src/PostSnippets/WPEditor.php CHANGED
@@ -11,7 +11,6 @@ class PostSnippets_WPEditor
11
 
12
  public function __construct()
13
  {
14
-
15
  // Add TinyMCE button
16
  add_action('init', array(&$this, 'addTinymceButton'));
17
 
@@ -80,7 +79,7 @@ class PostSnippets_WPEditor
80
  public function registerTinymceButton($buttons)
81
  {
82
  if (!$this->isEditingPost()) {
83
- return;
84
  }
85
 
86
  array_push($buttons, 'separator', self::TINYMCE_PLUGIN_NAME);
@@ -101,6 +100,10 @@ class PostSnippets_WPEditor
101
  */
102
  public function registerTinymcePlugin($plugins)
103
  {
 
 
 
 
104
  // Load the TinyMCE plugin, editor_plugin.js, into the array
105
  $plugins[self::TINYMCE_PLUGIN_NAME] =
106
  plugins_url('/tinymce/editor_plugin.js?ver=1.9', PostSnippets::FILE);
@@ -343,7 +346,7 @@ class PostSnippets_WPEditor
343
  {
344
  $screen = get_current_screen();
345
 
346
- return $screen->base == 'post';
347
  }
348
 
349
  /**
11
 
12
  public function __construct()
13
  {
 
14
  // Add TinyMCE button
15
  add_action('init', array(&$this, 'addTinymceButton'));
16
 
79
  public function registerTinymceButton($buttons)
80
  {
81
  if (!$this->isEditingPost()) {
82
+ return $buttons;
83
  }
84
 
85
  array_push($buttons, 'separator', self::TINYMCE_PLUGIN_NAME);
100
  */
101
  public function registerTinymcePlugin($plugins)
102
  {
103
+ if (!$this->isEditingPost()) {
104
+ return $plugins;
105
+ }
106
+
107
  // Load the TinyMCE plugin, editor_plugin.js, into the array
108
  $plugins[self::TINYMCE_PLUGIN_NAME] =
109
  plugins_url('/tinymce/editor_plugin.js?ver=1.9', PostSnippets::FILE);
346
  {
347
  $screen = get_current_screen();
348
 
349
+ return is_object($screen) ? $screen->base == 'post' : false;
350
  }
351
 
352
  /**