Category Posts Widget - Version 4.9.3

Version Description

  • March 18th 2020 =
  • Fixed Mouse hover icon and post format indication
Download this release

Release Info

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

Code changes from version 4.9.2 to 4.9.3

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.9.2
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
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.9.3
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
class-virtual-widget.php CHANGED
@@ -242,17 +242,17 @@ class Virtual_Widget {
242
  break;
243
  }
244
  $styles['post_format_thumb'] = '.cat-post-thumbnail span {position:relative}';
245
- $styles['post_format_icon_styling'] = '.cat-post-format:before {font-family: "cat_post"; position:absolute; color:#FFFFFF; font-size:64px; line-height: 1; ' . $placement . '}';
246
-
247
- $styles['post_format_icon_aside'] = ".cat-post-format-aside:before { content: '\\f0f6'; }";
248
- $styles['post_format_icon_chat'] = ".cat-post-format-chat:before { content: '\\e802'; }";
249
- $styles['post_format_icon_gallery'] = ".cat-post-format-gallery:before { content: '\\e805'; }";
250
- $styles['post_format_icon_link'] = ".cat-post-format-link:before { content: '\\e809'; }";
251
- $styles['post_format_icon_image'] = ".cat-post-format-image:before { content: '\\e800'; }";
252
- $styles['post_format_icon_quote'] = ".cat-post-format-quote:before { content: '\\f10d'; }";
253
- $styles['post_format_icon_status'] = ".cat-post-format-status:before { content: '\\e80a'; }";
254
- $styles['post_format_icon_video'] = ".cat-post-format-video:before { content: '\\e801'; }";
255
- $styles['post_format_icon_audio'] = ".cat-post-format-audio:before { content: '\\e803'; }";
256
 
257
  }
258
  }
@@ -351,14 +351,14 @@ class Virtual_Widget {
351
  " font-style: normal;\n" .
352
  "}\n";
353
 
354
- $ret['icon_hover_thumb'] = '#' . $widget_id . ' .cat-post-format-standard:before {opacity:0; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
355
- $ret['icon_hover_transform'] = '#' . $widget_id . ' .cat-post-thumbnail:hover .cat-post-format-standard:before {opacity:1;}';
356
  if ( isset( $settings['show_post_format'] ) && ( 'none' === $settings['show_post_format'] ) ) {
357
  $ret[] = '#' . $widget_id . ' .cat-post-thumbnail {position:relative}';
358
- $ret[] = '#' . $widget_id . ' .cat-post-icon .cat-post-format:before {font-family: "cat_post"; position:absolute; color:#FFFFFF; font-size:64px; line-height: 1; ' .
359
  'top:calc(50% - 34px); left:calc(50% - 34px);}';
360
  }
361
- $ret[] = '#' . $widget_id . " .cat-post-format-standard:before {padding-left:12px; content: '\\e806'; }";
362
  break;
363
  }
364
 
242
  break;
243
  }
244
  $styles['post_format_thumb'] = '.cat-post-thumbnail span {position:relative}';
245
+ $styles['post_format_icon_styling'] = '.cat-post-format:after {font-family: "cat_post"; position:absolute; color:#FFFFFF; font-size:64px; line-height: 1; ' . $placement . '}';
246
+
247
+ $styles['post_format_icon_aside'] = ".cat-post-format-aside:after { content: '\\f0f6'; }";
248
+ $styles['post_format_icon_chat'] = ".cat-post-format-chat:after { content: '\\e802'; }";
249
+ $styles['post_format_icon_gallery'] = ".cat-post-format-gallery:after { content: '\\e805'; }";
250
+ $styles['post_format_icon_link'] = ".cat-post-format-link:after { content: '\\e809'; }";
251
+ $styles['post_format_icon_image'] = ".cat-post-format-image:after { content: '\\e800'; }";
252
+ $styles['post_format_icon_quote'] = ".cat-post-format-quote:after { content: '\\f10d'; }";
253
+ $styles['post_format_icon_status'] = ".cat-post-format-status:after { content: '\\e80a'; }";
254
+ $styles['post_format_icon_video'] = ".cat-post-format-video:after { content: '\\e801'; }";
255
+ $styles['post_format_icon_audio'] = ".cat-post-format-audio:after { content: '\\e803'; }";
256
 
257
  }
258
  }
351
  " font-style: normal;\n" .
352
  "}\n";
353
 
354
+ $ret['icon_hover_thumb'] = '#' . $widget_id . ' .cat-post-format-standard:after {opacity:0; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
355
+ $ret['icon_hover_transform'] = '#' . $widget_id . ' .cat-post-thumbnail:hover .cat-post-format-standard:after {opacity:1;}';
356
  if ( isset( $settings['show_post_format'] ) && ( 'none' === $settings['show_post_format'] ) ) {
357
  $ret[] = '#' . $widget_id . ' .cat-post-thumbnail {position:relative}';
358
+ $ret[] = '#' . $widget_id . ' .cat-post-icon .cat-post-format:after {font-family: "cat_post"; position:absolute; color:#FFFFFF; font-size:64px; line-height: 1; ' .
359
  'top:calc(50% - 34px); left:calc(50% - 34px);}';
360
  }
361
+ $ret[] = '#' . $widget_id . " .cat-post-format-standard:after {padding-left:12px; content: '\\e806'; }";
362
  break;
363
  }
364
 
class-widget.php CHANGED
@@ -73,7 +73,7 @@ class Widget extends \WP_Widget {
73
  $format = get_post_format() ? : 'standard';
74
  $post_format_class = 'cat-post-format cat-post-format-' . $format;
75
  }
76
- $html = '<span class="cat-post-crop">' . $html . '</span>';
77
  } else {
78
  // use_css_cropping is not used.
79
  // wrap span.
@@ -1520,6 +1520,9 @@ class Widget extends \WP_Widget {
1520
  <option value="everything"><?php esc_html_e( 'All with icons', 'category-posts' ); ?></option>
1521
  </select>
1522
  <p><button type="button" class="button"><?php esc_html_e( 'Select this template', 'category-posts' ); ?></button></p>
 
 
 
1523
  </div>
1524
  </div>
1525
  <?php // Excerpt settings. ?>
@@ -1640,9 +1643,6 @@ class Widget extends \WP_Widget {
1640
  <?php esc_html_e( 'No default', 'category-posts' ); ?>
1641
  </button>
1642
  </p>
1643
- <?php
1644
- echo $this->get_checkbox_block_html( $instance, 'everything_is_link', esc_html__( 'Everything is a link', 'category-posts' ), true );
1645
- ?>
1646
  </div>
1647
  </div>
1648
  </div>
73
  $format = get_post_format() ? : 'standard';
74
  $post_format_class = 'cat-post-format cat-post-format-' . $format;
75
  }
76
+ $html = '<span class="cat-post-crop ' . $post_format_class . '">' . $html . '</span>';
77
  } else {
78
  // use_css_cropping is not used.
79
  // wrap span.
1520
  <option value="everything"><?php esc_html_e( 'All with icons', 'category-posts' ); ?></option>
1521
  </select>
1522
  <p><button type="button" class="button"><?php esc_html_e( 'Select this template', 'category-posts' ); ?></button></p>
1523
+ <?php
1524
+ echo $this->get_checkbox_block_html( $instance, 'everything_is_link', esc_html__( 'Everything is a link', 'category-posts' ), true );
1525
+ ?>
1526
  </div>
1527
  </div>
1528
  <?php // Excerpt settings. ?>
1643
  <?php esc_html_e( 'No default', 'category-posts' ); ?>
1644
  </button>
1645
  </p>
 
 
 
1646
  </div>
1647
  </div>
1648
  </div>
js/admin/category-posts-widget.js CHANGED
@@ -269,28 +269,28 @@
269
  thumb_w = _input_thumb_w.val() * 1.02;
270
  thumb_h = _input_thumb_h.val() * 1.02;
271
  } else if (_that.hasClass('square')) {
272
- if (_input_thumb_w.val() >= _input_thumb_h.val() ) {
273
- thumb_w = _input_thumb_h.val();
274
- thumb_h = _input_thumb_h.val();
275
- } else{
276
- thumb_w = _input_thumb_w.val();
277
  thumb_h = _input_thumb_w.val();
 
 
 
 
278
  }
279
  } else if (_that.hasClass('standard')) {
280
- if (_input_thumb_w.val() >= _input_thumb_h.val() ) {
281
- thumb_w = _input_thumb_h.val() * 4 / 3;
282
- thumb_h = _input_thumb_h.val();
283
  } else {
284
- thumb_w = _input_thumb_h.val() / 4 * 3
285
- thumb_h = _input_thumb_h.val();
286
  }
287
  } else if (_that.hasClass('wide')) {
288
- if (_input_thumb_w.val() >= _input_thumb_h.val() ) {
289
- thumb_w = _input_thumb_h.val() * 16 / 9;
290
- thumb_h = _input_thumb_h.val();
291
  } else {
292
- thumb_w = _input_thumb_h.val() / 16 * 9;
293
- thumb_h = _input_thumb_h.val();
294
  }
295
  } else if (_that.hasClass('switch')){
296
  thumb_h = _input_thumb_w.val();
@@ -476,7 +476,7 @@ jQuery(document).ready( function () {
476
  cwp_namespace.templateChange(this);
477
  });
478
 
479
- jQuery(document).on('click', class_namespace+' .cat-post-thumb-change-size button', function () { // find a thumbnail size
480
  cwp_namespace.thumbnailSizeChange(this);
481
  });
482
 
269
  thumb_w = _input_thumb_w.val() * 1.02;
270
  thumb_h = _input_thumb_h.val() * 1.02;
271
  } else if (_that.hasClass('square')) {
272
+ if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val()) ) {
 
 
 
 
273
  thumb_h = _input_thumb_w.val();
274
+ thumb_w = _input_thumb_w.val();
275
+ } else{
276
+ thumb_h = _input_thumb_h.val();
277
+ thumb_w = _input_thumb_h.val();
278
  }
279
  } else if (_that.hasClass('standard')) {
280
+ if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val()) ) {
281
+ thumb_h = _input_thumb_w.val() / 4 * 3
282
+ thumb_w = _input_thumb_w.val();
283
  } else {
284
+ thumb_h = _input_thumb_w.val() * 4 / 3;
285
+ thumb_w = _input_thumb_w.val();
286
  }
287
  } else if (_that.hasClass('wide')) {
288
+ if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val()) ) {
289
+ thumb_h = _input_thumb_w.val() / 16 * 9;
290
+ thumb_w = _input_thumb_w.val();
291
  } else {
292
+ thumb_h = _input_thumb_w.val() * 16 / 9;
293
+ thumb_w = _input_thumb_w.val();
294
  }
295
  } else if (_that.hasClass('switch')){
296
  thumb_h = _input_thumb_w.val();
476
  cwp_namespace.templateChange(this);
477
  });
478
 
479
+ jQuery(document).off('click').on('click', class_namespace+' .cat-post-thumb-change-size button', function () { // find a thumbnail size
480
  cwp_namespace.thumbnailSizeChange(this);
481
  });
482
 
js/admin/category-posts-widget.min.js CHANGED
@@ -1 +1 @@
1
- var cwp_namespace={php_settings_var:"categoryPosts",widget_class:".category-widget-cont",template_panel_prefix:".categoryposts-data-panel-",open_panels:{},template_change_timer:null,clickHandler:function(e){jQuery(e).toggleClass("open").next().stop().slideToggle();var t=jQuery(e).data("panel"),a=jQuery(e).parent().parent().parent().parent().parent().attr("id"),n={};this.open_panels.hasOwnProperty(a)&&(n=this.open_panels[a]),n.hasOwnProperty(t)?delete n[t]:n[t]=!0,this.open_panels[a]=n},toggleCatSelection:function(e){var t=jQuery(e).find("option:selected").attr("value"),a=e.parentElement.parentElement.parentElement.parentElement;"0"==t?(jQuery(a).find(".categoryPosts-title_link").hide(),jQuery(a).find(".categoryPosts-title_link_url").show(),jQuery(a).find(".categoryPosts-no_cat_childs").hide()):(jQuery(a).find(".categoryPosts-title_link").show(),jQuery(a).find(".categoryPosts-title_link_url").hide(),jQuery(a).find(".categoryPosts-no_cat_childs").show())},toggleDisableFontStyles:function(e){var t=jQuery(e).find("input").attr("checked"),a=e.parentElement.parentElement;"checked"==t?jQuery(a).find(".categoryposts-data-panel-general-disable-font-styles").hide():jQuery(a).find(".categoryposts-data-panel-general-disable-font-styles").show()},toggleDateFormat:function(e){var t=jQuery(e).val(),a=e.parentElement.parentElement;"other"!=t?jQuery(a).find(".categoryPosts-date_format").hide():jQuery(a).find(".categoryPosts-date_format").show()},toggleDateRange:function(e){var t=jQuery(e).val(),a=e.parentElement.parentElement;switch(jQuery(a).find(".categoryPosts-date-range p").hide(),jQuery(a).find(".categoryPosts-date-range").show(),t){case"off":jQuery(a).find(".categoryPosts-date-range").hide();break;case"days_ago":jQuery(a).find(".categoryPosts-days_ago").show();break;case"between_dates":jQuery(a).find(".categoryPosts-start_date").show(),jQuery(a).find(".categoryPosts-end_date").show()}},toggleNoMatch:function(e){var t=jQuery(e).val(),a=e.parentElement.parentElement;"text"==t?jQuery(a).find(".categoryPosts-no-match-text").show():jQuery(a).find(".categoryPosts-no-match-text").hide()},toggleTemplateHelp:function(e,t){t.preventDefault();var a=e.parentElement.parentElement.parentElement.parentElement;jQuery(a).find(".cat-post-template-help").toggle("slow")},toggleAssignedCategoriesTop:function(e){var t=jQuery(e).find("input").attr("checked"),a=e.parentElement.parentElement;"checked"==t?jQuery(a).find(".categoryposts-details-panel-assigned-cat-top").show():jQuery(a).find(".categoryposts-details-panel-assigned-cat-top").hide()},toggleHideTitle:function(e){var t=jQuery(e).attr("checked"),a=e.parentElement.parentElement.parentElement;"checked"!=t?jQuery(a).find(".categoryposts-data-panel-title-settings").show():jQuery(a).find(".categoryposts-data-panel-title-settings").hide()},toggleLoadMore:function(e){var t=jQuery(e).attr("checked"),a=e.parentElement.parentElement.parentElement;"checked"!=t?jQuery(a).find(".loadmore-settings").hide():jQuery(a).find(".loadmore-settings").show()},selectPremadeTemplate:function(e){var t=e.parentElement.parentElement.parentElement,a=e.parentElement.parentElement,n=jQuery(a).find("select"),o="%title%";switch(value=n.val(),value){case"title":o="%title%";break;case"title_excerpt":o="%title%\n\n%excerpt%";break;case"title_thumb":o="%title%\n\n%thumb%";break;case"title_thum_excerpt":o="%title%\n\n%thumb%\n%excerpt%";break;case"everything":o="%title%\n\n",o+="%date%\n\n",o+="%thumb%\n",o+='<span class="dashicons dashicons-admin-comments"></span> %commentnum% ',o+='<span class="dashicons dashicons-admin-users"></span> %author%\n',o+="%excerpt%",o+="Categories: %category% ",o+='<span class="dashicons dashicons-tag"></span> %post_tag%'}var l=jQuery(t).find("textarea");l.val(o),l.trigger("input","change")},autoCloseOpenPanels:function(e){if(tiptoppress[this.php_settings_var].accordion&&!jQuery(e).hasClass("open")){var t=jQuery(e).parent().find(".open");this.clickHandler(t)}},defaultThumbnailSelection:function(e,t,a){var n=wp.media({title:t,multiple:!1,library:{type:"image"},button:{text:a}});return n.on("close",function(){var t=n.state().get("selection").toJSON();if(1==t.length){var a=t[0],o='<img src="'+a.url+'" ';o+='width="60" ',o+='height="60" ',o+="/>",jQuery(e).parent().prev().find(".default_thumb_img").html(o),jQuery(e).parent().find(".cwp_default_thumb_remove").show(),jQuery(e).parent().prev().find(".default_thumb_id").val(a.id).change()}}),n.open(),!1},removeDefaultThumbnailSelection:function(e){return jQuery(e).parent().prev().find(".default_thumb_img").html(cwp_default_thumb_selection.none),jQuery(e).hide(),jQuery(e).parent().prev().find(".default_thumb_id").val(0).change(),!1},templateChange:function(e){function t(){var t=jQuery(e).val(),a=tiptoppress[this.php_settings_var].template_tags,n=jQuery(e.parentElement.parentElement.parentElement.parentElement);for(var o in a)-1!==t.indexOf(a[o])?n.find(this.template_panel_prefix+a[o]).show():n.find(this.template_panel_prefix+a[o]).hide()}null!=this.template_change_timer&&clearTimeout(this.template_change_timer),this.template_change_timer=setTimeout(t.bind(this),250)},thumbnailSizeChange:function(e){var t,a,n=jQuery(e),o=n.closest(".categoryposts-data-panel-thumb").find(".thumb_h"),l=n.closest(".categoryposts-data-panel-thumb").find(".thumb_w");return n.hasClass("smaller")?(a=l.val()/1.015,t=o.val()/1.015):n.hasClass("quarter")?(a=l.val()/4,t=o.val()/4):n.hasClass("half")?(t=o.val()/2,a=l.val()/2):n.hasClass("double")?(t=2*o.val(),a=2*l.val()):n.hasClass("bigger")?(a=1.02*l.val(),t=1.02*o.val()):n.hasClass("square")?l.val()>=o.val()?(a=o.val(),t=o.val()):(a=l.val(),t=l.val()):n.hasClass("standard")?l.val()>=o.val()?(a=4*o.val()/3,t=o.val()):(a=o.val()/4*3,t=o.val()):n.hasClass("wide")?l.val()>=o.val()?(a=16*o.val()/9,t=o.val()):(a=o.val()/16*9,t=o.val()):n.hasClass("switch")?(t=l.val(),a=o.val()):(a=n.data("thumb-w"),t=n.data("thumb-h")),l.val(Math.floor(a)),o.val(Math.floor(t)),l.trigger("input","change"),o.trigger("input","change"),!1},thumbnailFluidWidthChange:function(e){var t=jQuery(e),a=t.closest(".categoryposts-data-panel-thumb").find(".thumb_h");return t.closest("label").find("span").html(t.val()+"%"),a.val(0),a.trigger("input","change"),!1},openAddPlaceholder:function(e){var t=jQuery(e);return t.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").toggle(),t.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu span").off("click").on("click",function(){var e=jQuery(this).data("value");switch(e){case"NewLine":e="\n";break;case"EmptyLine":e="\n\n";break;default:e="%"+e+"%"}var t=this.parentElement.parentElement.parentElement,a=jQuery(t).find("textarea"),n=a[0].selectionStart,o=a.val();a.val(o.substring(0,n)+e+o.substring(n)),a[0].selectionStart=n+e.length,a[0].selectionEnd=n+e.length,a.focus(),a.trigger("input","change")}),t.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").on("mouseenter",function(){jQuery(this).addClass("cpw-doNotClose")}),t.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").on("mouseleave",function(){jQuery(this).removeClass("cpw-doNotClose")}),!1},selectPlaceholderHelper:function(e){var t=jQuery(e),a=t[0].selectionStart,n=t.val(),o=n.substring(0,a).lastIndexOf("%"),l=a+n.substring(a).indexOf("%")+1,s=n.substring(o,l);return!(s.indexOf("\n")>=0||s.indexOf(" ")>=0||s.length<=2)&&(t[0].selectionStart=o,t[0].selectionEnd=l,!1)}};jQuery(document).ready(function(){function e(){jQuery(".cwp_default_thumb_select").off("click").on("click",function(){cwp_namespace.defaultThumbnailSelection(this,cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title)}),jQuery(document).on("change",t+" .categoryposts-data-panel-filter-cat",function(){cwp_namespace.toggleCatSelection(this)}),jQuery(".cwp_default_thumb_remove").off("click").on("click",function(){cwp_namespace.removeDefaultThumbnailSelection(this)}),jQuery(t+"-assigned_categories").off("click").on("click",function(){cwp_namespace.toggleAssignedCategoriesTop(this)}),jQuery(document).on("click",t+" .categoryPosts-hide_title input",function(){cwp_namespace.toggleHideTitle(this)}),jQuery(document).on("click",t+" .categoryPosts-enable_loadmore input",function(){cwp_namespace.toggleLoadMore(this)}),jQuery(document).on("change",t+" .categoryPosts-preset_date_format select",function(){cwp_namespace.toggleDateFormat(this)}),jQuery(document).on("change",t+" .categoryPosts-date_range select",function(){cwp_namespace.toggleDateRange(this)}),jQuery(document).on("change",t+" .categoryPosts-no_match_handling select",function(){cwp_namespace.toggleNoMatch(this)}),jQuery(t+" a.toggle-template-help").off("click").on("click",function(e){cwp_namespace.toggleTemplateHelp(this,e)}),jQuery(document).on("click",t+" .cat-post-premade_templates button",function(){cwp_namespace.selectPremadeTemplate(this)}),jQuery(document).on("change",t+" .cat-post-premade_templates select",function(e){e.preventDefault(),e.stopPropagation()}),jQuery(document).on("input",t+" .categoryPosts-template textarea",function(){cwp_namespace.templateChange(this)}),jQuery(document).on("click",t+" .cat-post-thumb-change-size button",function(){cwp_namespace.thumbnailSizeChange(this)}),jQuery(document).on("change",t+" .thumb_fluid_width",function(){cwp_namespace.thumbnailFluidWidthChange(this)}),jQuery(t+" .cpwp-open-placholder-dropdown-menu").off("click").on("click",function(){cwp_namespace.openAddPlaceholder(this)}),jQuery(document).on("onfocusout, blur",t+" .cpwp-open-placholder-dropdown-menu,"+t+" .categoryPosts-template textarea",function(){jQuery(this).closest(t+" .categoryPosts-template").parent().find(".cpwp-placeholder-dropdown-menu").not(".cpw-doNotClose").hide()}),jQuery(document).on("mousedown",t+" .categoryPosts-template textarea",function(){var e=this;setTimeout(function(){cwp_namespace.selectPlaceholderHelper(e)},0)})}var t=".category-widget-cont";jQuery(".category-widget-cont h4").click(function(){cwp_namespace.autoCloseOpenPanels(this),cwp_namespace.clickHandler(this)}),jQuery(document).on("widget-added widget-updated panelsopen",function(t,a){jQuery(".category-widget-cont h4").off("click").on("click",function(){cwp_namespace.autoCloseOpenPanels(this),cwp_namespace.clickHandler(this)}),jQuery(".cwp_default_thumb_select").off("click").on("click",function(){cwp_namespace.defaultThumbnailSelection(this,cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title)}),jQuery(".cwp_default_thumb_remove").off("click").on("click",function(){cwp_namespace.removeDefaultThumbnailSelection(this)});var n=jQuery(a).attr("id");if(cwp_namespace.open_panels.hasOwnProperty(n)){var o=cwp_namespace.open_panels[n];for(var l in o)jQuery(a).find("[data-panel="+l+"]").toggleClass("open").next().stop().show()}e()}),e()});
1
+ var cwp_namespace={php_settings_var:"categoryPosts",widget_class:".category-widget-cont",template_panel_prefix:".categoryposts-data-panel-",open_panels:{},template_change_timer:null,clickHandler:function(e){jQuery(e).toggleClass("open").next().stop().slideToggle();var t=jQuery(e).data("panel"),a=jQuery(e).parent().parent().parent().parent().parent().attr("id"),n={};this.open_panels.hasOwnProperty(a)&&(n=this.open_panels[a]),n.hasOwnProperty(t)?delete n[t]:n[t]=!0,this.open_panels[a]=n},toggleCatSelection:function(e){var t=jQuery(e).find("option:selected").attr("value"),a=e.parentElement.parentElement.parentElement.parentElement;"0"==t?(jQuery(a).find(".categoryPosts-title_link").hide(),jQuery(a).find(".categoryPosts-title_link_url").show(),jQuery(a).find(".categoryPosts-no_cat_childs").hide()):(jQuery(a).find(".categoryPosts-title_link").show(),jQuery(a).find(".categoryPosts-title_link_url").hide(),jQuery(a).find(".categoryPosts-no_cat_childs").show())},toggleDisableFontStyles:function(e){var t=jQuery(e).find("input").attr("checked"),a=e.parentElement.parentElement;"checked"==t?jQuery(a).find(".categoryposts-data-panel-general-disable-font-styles").hide():jQuery(a).find(".categoryposts-data-panel-general-disable-font-styles").show()},toggleDateFormat:function(e){var t=jQuery(e).val(),a=e.parentElement.parentElement;"other"!=t?jQuery(a).find(".categoryPosts-date_format").hide():jQuery(a).find(".categoryPosts-date_format").show()},toggleDateRange:function(e){var t=jQuery(e).val(),a=e.parentElement.parentElement;switch(jQuery(a).find(".categoryPosts-date-range p").hide(),jQuery(a).find(".categoryPosts-date-range").show(),t){case"off":jQuery(a).find(".categoryPosts-date-range").hide();break;case"days_ago":jQuery(a).find(".categoryPosts-days_ago").show();break;case"between_dates":jQuery(a).find(".categoryPosts-start_date").show(),jQuery(a).find(".categoryPosts-end_date").show()}},toggleNoMatch:function(e){var t=jQuery(e).val(),a=e.parentElement.parentElement;"text"==t?jQuery(a).find(".categoryPosts-no-match-text").show():jQuery(a).find(".categoryPosts-no-match-text").hide()},toggleTemplateHelp:function(e,t){t.preventDefault();var a=e.parentElement.parentElement.parentElement.parentElement;jQuery(a).find(".cat-post-template-help").toggle("slow")},toggleAssignedCategoriesTop:function(e){var t=jQuery(e).find("input").attr("checked"),a=e.parentElement.parentElement;"checked"==t?jQuery(a).find(".categoryposts-details-panel-assigned-cat-top").show():jQuery(a).find(".categoryposts-details-panel-assigned-cat-top").hide()},toggleHideTitle:function(e){var t=jQuery(e).attr("checked"),a=e.parentElement.parentElement.parentElement;"checked"!=t?jQuery(a).find(".categoryposts-data-panel-title-settings").show():jQuery(a).find(".categoryposts-data-panel-title-settings").hide()},toggleLoadMore:function(e){var t=jQuery(e).attr("checked"),a=e.parentElement.parentElement.parentElement;"checked"!=t?jQuery(a).find(".loadmore-settings").hide():jQuery(a).find(".loadmore-settings").show()},selectPremadeTemplate:function(e){var t=e.parentElement.parentElement.parentElement,a=e.parentElement.parentElement,n=jQuery(a).find("select"),o="%title%";switch(value=n.val(),value){case"title":o="%title%";break;case"title_excerpt":o="%title%\n\n%excerpt%";break;case"title_thumb":o="%title%\n\n%thumb%";break;case"title_thum_excerpt":o="%title%\n\n%thumb%\n%excerpt%";break;case"everything":o="%title%\n\n",o+="%date%\n\n",o+="%thumb%\n",o+='<span class="dashicons dashicons-admin-comments"></span> %commentnum% ',o+='<span class="dashicons dashicons-admin-users"></span> %author%\n',o+="%excerpt%",o+="Categories: %category% ",o+='<span class="dashicons dashicons-tag"></span> %post_tag%'}var l=jQuery(t).find("textarea");l.val(o),l.trigger("input","change")},autoCloseOpenPanels:function(e){if(tiptoppress[this.php_settings_var].accordion&&!jQuery(e).hasClass("open")){var t=jQuery(e).parent().find(".open");this.clickHandler(t)}},defaultThumbnailSelection:function(e,t,a){var n=wp.media({title:t,multiple:!1,library:{type:"image"},button:{text:a}});return n.on("close",function(){var t=n.state().get("selection").toJSON();if(1==t.length){var a=t[0],o='<img src="'+a.url+'" ';o+='width="60" ',o+='height="60" ',o+="/>",jQuery(e).parent().prev().find(".default_thumb_img").html(o),jQuery(e).parent().find(".cwp_default_thumb_remove").show(),jQuery(e).parent().prev().find(".default_thumb_id").val(a.id).change()}}),n.open(),!1},removeDefaultThumbnailSelection:function(e){return jQuery(e).parent().prev().find(".default_thumb_img").html(cwp_default_thumb_selection.none),jQuery(e).hide(),jQuery(e).parent().prev().find(".default_thumb_id").val(0).change(),!1},templateChange:function(e){function t(){var t=jQuery(e).val(),a=tiptoppress[this.php_settings_var].template_tags,n=jQuery(e.parentElement.parentElement.parentElement.parentElement);for(var o in a)-1!==t.indexOf(a[o])?n.find(this.template_panel_prefix+a[o]).show():n.find(this.template_panel_prefix+a[o]).hide()}null!=this.template_change_timer&&clearTimeout(this.template_change_timer),this.template_change_timer=setTimeout(t.bind(this),250)},thumbnailSizeChange:function(e){var t,a,n=jQuery(e),o=n.closest(".categoryposts-data-panel-thumb").find(".thumb_h"),l=n.closest(".categoryposts-data-panel-thumb").find(".thumb_w");return n.hasClass("smaller")?(a=l.val()/1.015,t=o.val()/1.015):n.hasClass("quarter")?(a=l.val()/4,t=o.val()/4):n.hasClass("half")?(t=o.val()/2,a=l.val()/2):n.hasClass("double")?(t=2*o.val(),a=2*l.val()):n.hasClass("bigger")?(a=1.02*l.val(),t=1.02*o.val()):n.hasClass("square")?parseInt(l.val())>=parseInt(o.val())?(t=l.val(),a=l.val()):(t=o.val(),a=o.val()):n.hasClass("standard")?parseInt(l.val())>=parseInt(o.val())?(t=l.val()/4*3,a=l.val()):(t=4*l.val()/3,a=l.val()):n.hasClass("wide")?parseInt(l.val())>=parseInt(o.val())?(t=l.val()/16*9,a=l.val()):(t=16*l.val()/9,a=l.val()):n.hasClass("switch")?(t=l.val(),a=o.val()):(a=n.data("thumb-w"),t=n.data("thumb-h")),l.val(Math.floor(a)),o.val(Math.floor(t)),l.trigger("input","change"),o.trigger("input","change"),!1},thumbnailFluidWidthChange:function(e){var t=jQuery(e),a=t.closest(".categoryposts-data-panel-thumb").find(".thumb_h");return t.closest("label").find("span").html(t.val()+"%"),a.val(0),a.trigger("input","change"),!1},openAddPlaceholder:function(e){var t=jQuery(e);return t.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").toggle(),t.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu span").off("click").on("click",function(){var e=jQuery(this).data("value");switch(e){case"NewLine":e="\n";break;case"EmptyLine":e="\n\n";break;default:e="%"+e+"%"}var t=this.parentElement.parentElement.parentElement,a=jQuery(t).find("textarea"),n=a[0].selectionStart,o=a.val();a.val(o.substring(0,n)+e+o.substring(n)),a[0].selectionStart=n+e.length,a[0].selectionEnd=n+e.length,a.focus(),a.trigger("input","change")}),t.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").on("mouseenter",function(){jQuery(this).addClass("cpw-doNotClose")}),t.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").on("mouseleave",function(){jQuery(this).removeClass("cpw-doNotClose")}),!1},selectPlaceholderHelper:function(e){var t=jQuery(e),a=t[0].selectionStart,n=t.val(),o=n.substring(0,a).lastIndexOf("%"),l=a+n.substring(a).indexOf("%")+1,s=n.substring(o,l);return!(s.indexOf("\n")>=0||s.indexOf(" ")>=0||s.length<=2)&&(t[0].selectionStart=o,t[0].selectionEnd=l,!1)}};jQuery(document).ready(function(){function e(){jQuery(".cwp_default_thumb_select").off("click").on("click",function(){cwp_namespace.defaultThumbnailSelection(this,cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title)}),jQuery(document).on("change",t+" .categoryposts-data-panel-filter-cat",function(){cwp_namespace.toggleCatSelection(this)}),jQuery(".cwp_default_thumb_remove").off("click").on("click",function(){cwp_namespace.removeDefaultThumbnailSelection(this)}),jQuery(t+"-assigned_categories").off("click").on("click",function(){cwp_namespace.toggleAssignedCategoriesTop(this)}),jQuery(document).on("click",t+" .categoryPosts-hide_title input",function(){cwp_namespace.toggleHideTitle(this)}),jQuery(document).on("click",t+" .categoryPosts-enable_loadmore input",function(){cwp_namespace.toggleLoadMore(this)}),jQuery(document).on("change",t+" .categoryPosts-preset_date_format select",function(){cwp_namespace.toggleDateFormat(this)}),jQuery(document).on("change",t+" .categoryPosts-date_range select",function(){cwp_namespace.toggleDateRange(this)}),jQuery(document).on("change",t+" .categoryPosts-no_match_handling select",function(){cwp_namespace.toggleNoMatch(this)}),jQuery(t+" a.toggle-template-help").off("click").on("click",function(e){cwp_namespace.toggleTemplateHelp(this,e)}),jQuery(document).on("click",t+" .cat-post-premade_templates button",function(){cwp_namespace.selectPremadeTemplate(this)}),jQuery(document).on("change",t+" .cat-post-premade_templates select",function(e){e.preventDefault(),e.stopPropagation()}),jQuery(document).on("input",t+" .categoryPosts-template textarea",function(){cwp_namespace.templateChange(this)}),jQuery(document).off("click").on("click",t+" .cat-post-thumb-change-size button",function(){cwp_namespace.thumbnailSizeChange(this)}),jQuery(document).on("change",t+" .thumb_fluid_width",function(){cwp_namespace.thumbnailFluidWidthChange(this)}),jQuery(t+" .cpwp-open-placholder-dropdown-menu").off("click").on("click",function(){cwp_namespace.openAddPlaceholder(this)}),jQuery(document).on("onfocusout, blur",t+" .cpwp-open-placholder-dropdown-menu,"+t+" .categoryPosts-template textarea",function(){jQuery(this).closest(t+" .categoryPosts-template").parent().find(".cpwp-placeholder-dropdown-menu").not(".cpw-doNotClose").hide()}),jQuery(document).on("mousedown",t+" .categoryPosts-template textarea",function(){var e=this;setTimeout(function(){cwp_namespace.selectPlaceholderHelper(e)},0)})}var t=".category-widget-cont";jQuery(".category-widget-cont h4").click(function(){cwp_namespace.autoCloseOpenPanels(this),cwp_namespace.clickHandler(this)}),jQuery(document).on("widget-added widget-updated panelsopen",function(t,a){jQuery(".category-widget-cont h4").off("click").on("click",function(){cwp_namespace.autoCloseOpenPanels(this),cwp_namespace.clickHandler(this)}),jQuery(".cwp_default_thumb_select").off("click").on("click",function(){cwp_namespace.defaultThumbnailSelection(this,cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title)}),jQuery(".cwp_default_thumb_remove").off("click").on("click",function(){cwp_namespace.removeDefaultThumbnailSelection(this)});var n=jQuery(a).attr("id");if(cwp_namespace.open_panels.hasOwnProperty(n)){var o=cwp_namespace.open_panels[n];for(var l in o)jQuery(a).find("[data-panel="+l+"]").toggleClass("open").next().stop().show()}e()}),e()});
loadmore.php CHANGED
@@ -43,7 +43,7 @@ function get_next_elements( \WP_REST_Request $request ) {
43
  $number = (int) $request['number'];
44
  $context = (string) $request['context'];
45
 
46
- $ret = [];
47
 
48
  $id_components = explode( '-', $id );
49
  if ( 2 <= count( $id_components ) ) {
43
  $number = (int) $request['number'];
44
  $context = (string) $request['context'];
45
 
46
+ $ret = array();
47
 
48
  $id_components = explode( '-', $id );
49
  if ( 2 <= count( $id_components ) ) {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mark-k, kometschuh, mkrdip
3
  Donate link: https://wordpress.org/support/plugin/category-posts/reviews/
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: 5.2
7
- Stable tag: 4.9.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -126,6 +126,9 @@ The FireFox browser has a coverage of 5%, which we find little. For this 5%, we
126
  == Changelog ==
127
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget)
128
 
 
 
 
129
  = 4.9.2 - Mai 23th 2019 =
130
  * Fixed Starts with post
131
  * Fixed Replace the figure-element
3
  Donate link: https://wordpress.org/support/plugin/category-posts/reviews/
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: 5.3
7
+ Stable tag: 4.9.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
126
  == Changelog ==
127
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget)
128
 
129
+ = 4.9.3 - March 18th 2020 =
130
+ * Fixed Mouse hover icon and post format indication
131
+
132
  = 4.9.2 - Mai 23th 2019 =
133
  * Fixed Starts with post
134
  * Fixed Replace the figure-element