Category Posts Widget - Version 4.8.4

Version Description

  • April 02nd 2018 =
  • Fixed Make widget SiteOrigin Page Builder Compatible
Download this release

Release Info

Developer Kometschuh
Plugin Icon 128x128 Category Posts Widget
Version 4.8.4
Comparing to
See all releases

Code changes from version 4.8.3 to 4.8.4

cat-posts.php CHANGED
@@ -12,7 +12,7 @@ Plugin Name: Category Posts Widget
12
  Plugin URI: https://wordpress.org/plugins/category-posts/
13
  Description: Adds a widget that shows the most recent posts from a single category.
14
  Author: TipTopPress
15
- Version: 4.8.3
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
@@ -170,7 +170,7 @@ add_action( 'wp_head', __NAMESPACE__ . '\wp_head' );
170
  */
171
  function admin_scripts( $hook ) {
172
 
173
- if ( 'widgets.php' === $hook ) { // enqueue only for widget admin and customizer.
174
 
175
  // control open and close the widget section.
176
  wp_register_script( 'category-posts-widget-admin-js', plugins_url( 'js/admin/category-posts-widget.js', __FILE__ ), array( 'jquery' ), VERSION, true );
@@ -215,6 +215,9 @@ function load_textdomain() {
215
 
216
  add_action( 'admin_print_styles-widgets.php', __NAMESPACE__ . '\admin_styles' );
217
 
 
 
 
218
  /**
219
  * Add required admin styles.
220
  *
12
  Plugin URI: https://wordpress.org/plugins/category-posts/
13
  Description: Adds a widget that shows the most recent posts from a single category.
14
  Author: TipTopPress
15
+ Version: 4.8.4
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
170
  */
171
  function admin_scripts( $hook ) {
172
 
173
+ if ( 'widgets.php' === $hook || 'post.php' === $hook ) { // enqueue only for widget admin and customizer. (add if post.php: fix make widget SiteOrigin Page Builder plugin, GH issue #181)
174
 
175
  // control open and close the widget section.
176
  wp_register_script( 'category-posts-widget-admin-js', plugins_url( 'js/admin/category-posts-widget.js', __FILE__ ), array( 'jquery' ), VERSION, true );
215
 
216
  add_action( 'admin_print_styles-widgets.php', __NAMESPACE__ . '\admin_styles' );
217
 
218
+ // fix make widget SiteOrigin Page Builder plugin, GH issue #181
219
+ add_action('siteorigin_panel_enqueue_admin_scripts', __NAMESPACE__ . '\admin_styles' );
220
+
221
  /**
222
  * Add required admin styles.
223
  *
js/admin/category-posts-widget.js CHANGED
@@ -125,10 +125,10 @@
125
  template = '%title%\n\n';
126
  template += '%date%\n\n';
127
  template += '%thumb%\n';
128
- template += '<span class="dashicons dashicons-admin-comments"></span> %commentnum% // ';
129
  template += '<span class="dashicons dashicons-admin-users"></span> %author%\n';
130
  template += '%excerpt%\n';
131
- template += 'Categories: %category% // ';
132
  template += '<span class="dashicons dashicons-tag"></span> %post_tag%';
133
  }
134
  var textarea = jQuery(panel).find('textarea');
@@ -218,7 +218,7 @@ jQuery(document).ready( function () {
218
  });
219
 
220
  // needed to reassign click handlers after widget refresh
221
- jQuery(document).on('widget-added widget-updated', function(root,element){ // for customize and after save on widgets page
222
 
223
  jQuery('.category-widget-cont h4').off('click').on('click', function () {
224
  cwp_namespace.autoCloseOpenPanels(this);
125
  template = '%title%\n\n';
126
  template += '%date%\n\n';
127
  template += '%thumb%\n';
128
+ template += '<span class="dashicons dashicons-admin-comments"></span> %commentnum% ';
129
  template += '<span class="dashicons dashicons-admin-users"></span> %author%\n';
130
  template += '%excerpt%\n';
131
+ template += 'Categories: %category% ';
132
  template += '<span class="dashicons dashicons-tag"></span> %post_tag%';
133
  }
134
  var textarea = jQuery(panel).find('textarea');
218
  });
219
 
220
  // needed to reassign click handlers after widget refresh
221
+ jQuery(document).on('widget-added widget-updated panelsopen', function(root,element){ // for customize and after save on widgets page (add panelsopen: fix make widget SiteOrigin Page Builder plugin, GH issue #181)
222
 
223
  jQuery('.category-widget-cont h4').off('click').on('click', function () {
224
  cwp_namespace.autoCloseOpenPanels(this);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://mkrdip.me/donate
4
  Tags: category, categories, posts, widget, posts widget, recent posts, category recent posts, shortcode, sidebar, excerpt, multiple widgets
5
  Requires at least: 2.8
6
  Tested up to: 4.9
7
- Stable tag: 4.8.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -159,6 +159,9 @@ Check also the .htaccess file, if there is an entry for an older PHP version.
159
  == Changelog ==
160
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget?utm_source=wordpress_org&utm_campaign=changelog_cpw&utm_medium=web)
161
 
 
 
 
162
  = 4.8.3 - March 03th 2018 =
163
  * Fixed Updated widget with zero for the thumb dimensions caused a JavaScript error
164
 
4
  Tags: category, categories, posts, widget, posts widget, recent posts, category recent posts, shortcode, sidebar, excerpt, multiple widgets
5
  Requires at least: 2.8
6
  Tested up to: 4.9
7
+ Stable tag: 4.8.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
159
  == Changelog ==
160
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget?utm_source=wordpress_org&utm_campaign=changelog_cpw&utm_medium=web)
161
 
162
+ = 4.8.4 - April 02nd 2018 =
163
+ * Fixed Make widget SiteOrigin Page Builder Compatible
164
+
165
  = 4.8.3 - March 03th 2018 =
166
  * Fixed Updated widget with zero for the thumb dimensions caused a JavaScript error
167