Category Posts Widget - Version 4.8.1

Version Description

  • January 25th 2018 =
  • Fixed Recognize "Empty lines" > Next line is a paragraph in the Templaste
Download this release

Release Info

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

Code changes from version 4.8 to 4.8.1

Files changed (3) hide show
  1. cat-posts.php +16 -16
  2. js/admin/category-posts-widget.js +10 -9
  3. readme.txt +18 -14
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
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
@@ -369,39 +369,39 @@ function get_template_regex() {
369
  */
370
  function convert_settings_to_template( $instance ) {
371
 
372
- $thumbtop = false;
373
-
374
  $template = '';
375
 
376
  if ( isset( $instance['thumb'] ) && $instance['thumb'] ) {
377
  if ( isset( $instance['thumbTop'] ) && $instance['thumbTop'] ) {
378
- $template .= "%thumb%";
379
- $thumbtop = true;
 
 
380
  } elseif ( isset( $instance['date'] ) && $instance['date'] ) {
381
  if ( ! ( isset( $instance['hide_post_titles'] ) && $instance['hide_post_titles'] ) ) {
382
- $template .= "%title%";
383
  }
384
- $template .= "%date%";
385
- $template .= "%thumb%";
386
  } elseif ( ! ( isset( $instance['hide_post_titles'] ) && $instance['hide_post_titles'] ) ) {
387
- $template .= "%thumb%%title%";
388
  }
389
  } else {
390
  if ( ! ( isset( $instance['hide_post_titles'] ) && $instance['hide_post_titles'] ) ) {
391
- $template .= "%title%";
392
  }
393
  if ( isset( $instance['date'] ) && $instance['date'] ) {
394
- $template .= "%date%";
395
  }
396
  }
397
  if ( isset( $instance['excerpt'] ) && $instance['excerpt'] ) {
398
  $template .= '%excerpt%';
399
  }
400
  if ( isset( $instance['comment_num'] ) && $instance['comment_num'] ) {
401
- $template .= "%commentnum%";
402
  }
403
  if ( isset( $instance['author'] ) && $instance['author'] ) {
404
- $template .= "%author%";
405
  }
406
 
407
  return $template;
@@ -1165,11 +1165,11 @@ class Widget extends \WP_Widget {
1165
 
1166
  // Replace empty line with closing and opening DIV.
1167
  $template_res = trim( $template_res );
1168
- $template_res = str_replace( "\r\n\r\n", '</div><div>', $template_res );
1169
  $template_res = '<div>' . $template_res . '</div>';
1170
 
1171
  // replace new lines with spaces.
1172
- $template_res = str_replace( "\r\n", ' ', $template_res );
1173
 
1174
  $ret .= $template_res;
1175
 
@@ -2208,7 +2208,7 @@ function default_settings() {
2208
  'no_cat_childs' => false,
2209
  'everything_is_link' => false,
2210
  'preset_date_format' => 'sitedateandtime',
2211
- 'template' => "%title%\n%thumb%",
2212
  'text_do_not_wrap_thumb' => false,
2213
  );
2214
  }
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.1
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
369
  */
370
  function convert_settings_to_template( $instance ) {
371
 
 
 
372
  $template = '';
373
 
374
  if ( isset( $instance['thumb'] ) && $instance['thumb'] ) {
375
  if ( isset( $instance['thumbTop'] ) && $instance['thumbTop'] ) {
376
+ $template .= "%thumb%\n\n";
377
+ if ( ! ( isset( $instance['hide_post_titles'] ) && $instance['hide_post_titles'] ) ) {
378
+ $template .= "%title%\n";
379
+ }
380
  } elseif ( isset( $instance['date'] ) && $instance['date'] ) {
381
  if ( ! ( isset( $instance['hide_post_titles'] ) && $instance['hide_post_titles'] ) ) {
382
+ $template .= "%title%\n\n";
383
  }
384
+ $template .= "%date%\n\n";
385
+ $template .= "%thumb%\n";
386
  } elseif ( ! ( isset( $instance['hide_post_titles'] ) && $instance['hide_post_titles'] ) ) {
387
+ $template .= "%thumb%\n%title%\n";
388
  }
389
  } else {
390
  if ( ! ( isset( $instance['hide_post_titles'] ) && $instance['hide_post_titles'] ) ) {
391
+ $template .= "%title%\n";
392
  }
393
  if ( isset( $instance['date'] ) && $instance['date'] ) {
394
+ $template .= "%date%\n\n";
395
  }
396
  }
397
  if ( isset( $instance['excerpt'] ) && $instance['excerpt'] ) {
398
  $template .= '%excerpt%';
399
  }
400
  if ( isset( $instance['comment_num'] ) && $instance['comment_num'] ) {
401
+ $template .= "%commentnum%\n\n";
402
  }
403
  if ( isset( $instance['author'] ) && $instance['author'] ) {
404
+ $template .= "%author%\n\n";
405
  }
406
 
407
  return $template;
1165
 
1166
  // Replace empty line with closing and opening DIV.
1167
  $template_res = trim( $template_res );
1168
+ $template_res = str_replace( "\n\n", '</div><div>', $template_res );
1169
  $template_res = '<div>' . $template_res . '</div>';
1170
 
1171
  // replace new lines with spaces.
1172
+ $template_res = str_replace( "\n\n", ' ', $template_res );
1173
 
1174
  $ret .= $template_res;
1175
 
2208
  'no_cat_childs' => false,
2209
  'everything_is_link' => false,
2210
  'preset_date_format' => 'sitedateandtime',
2211
+ 'template' => "%title%\n\n%thumb%",
2212
  'text_do_not_wrap_thumb' => false,
2213
  );
2214
  }
js/admin/category-posts-widget.js CHANGED
@@ -113,21 +113,22 @@
113
  template = '%title%';
114
  break;
115
  case 'title_excerpt':
116
- template = '%title%\n%excerpt%';
117
  break;
118
  case 'title_thumb':
119
- template = '%title%\n%thumb%';
120
  break;
121
  case 'title_thum_excerpt':
122
- template = '%title%\n%thumb%\n%excerpt%';
123
  break;
124
  case 'everything':
125
- template = '%thumb%\n\n';
126
- template += '%title%\n\n';
127
- template += '%date% // <span class="dashicons dashicons-admin-comments"></span> %commentnum%\n\n';
128
- template += '<span class="dashicons dashicons-admin-users"></span> %author%\n\n';
129
- template += '%excerpt%\n\n';
130
- template += 'Categories: %category%\n\n';
 
131
  template += '<span class="dashicons dashicons-tag"></span> %post_tag%';
132
  }
133
  var textarea = jQuery(panel).find('textarea');
113
  template = '%title%';
114
  break;
115
  case 'title_excerpt':
116
+ template = '%title%\n\n%excerpt%';
117
  break;
118
  case 'title_thumb':
119
+ template = '%title%\n\n%thumb%';
120
  break;
121
  case 'title_thum_excerpt':
122
+ template = '%title%\n\n%thumb%\n%excerpt%';
123
  break;
124
  case 'everything':
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');
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
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -37,7 +37,7 @@ We've also started creating free widget Add-ons for the Premium Widget here: [Wi
37
  * SVG icon support for post formats
38
  * Template to arrange the post details
39
  * Premade Templates
40
- * The Template text can a placeholder, text, HTML or HTML for icons
41
  * New date format: Time since plublished
42
  * Filter by post status: Published, scheduled, private
43
  * New hover effect: SVG icon
@@ -91,11 +91,11 @@ While using this plugin if you find any bug or any conflict, please submit an is
91
 
92
  == Installation ==
93
  = Automatic installation =
94
- Automatic installation is the easiest option as WordPress handles the file transfers itself and you dont need to leave your web browser. To do an automatic install of Category Posts Widget,
95
 
96
  1. log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
97
- 2. In the search field type Category Posts Widget and click Search Plugins.
98
- 3. Once youve found plugin, you can install it by simply clicking Install Now”.
99
  4. Then, go to plugins page of WordPress admin activate the plugin.
100
  5. Now, goto the Widgets page of the Appearance section and configure the Category Posts widget.
101
 
@@ -111,11 +111,11 @@ Automatic installation is the easiest option as WordPress handles the file trans
111
  * Version 3.0 or later version uses WordPress 2.9's built in post thumbnail functionality.
112
 
113
  == Frequently Asked Questions ==
114
- = Template and post detail =
115
- Here You can control the [Post Detail parts](http://tiptoppress.com/category-posts-widget/documentation-4-8/#Post_details), which appears as part of the post item. All post detail will placed as placeholder. The text in the Template area can be a placeholder, text, HTML code or HTML code for icons.
116
 
117
- = SVG icons =
118
- For SVG icon HTML we recommend the WordPress Dashicons, which are included as default and can be used without any icon-font including [Dashicons](https://developer.wordpress.org/resource/dashicons/).
119
 
120
  = How Category Posts Widget work with SiteOrigin Page Builder =
121
  Please add the widget with shortcode [catposts] inside a editor widget which is placed to a SiteOrigin Page Builder row.
@@ -149,15 +149,19 @@ We know there are peopel how use PHP 5.2 [wordpress.org/about/stats](https://wor
149
  Check also the .htaccess file, if there is an entry for an older PHP version.
150
 
151
  == Screenshots ==
152
- 1. SVG icons support and hover effects
153
- 2. Template to arrange the post details
154
- 3. Use shortcode [catposts] in the content and edit options in the customizer.
155
- 4. The widget configuration dialog.
156
- 5. Front end of the widget using a default WordPress Theme.
 
157
 
158
  == Changelog ==
159
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget?utm_source=wordpress_org&utm_campaign=changelog_cpw&utm_medium=web)
160
 
 
 
 
161
  = 4.8 - January 22th 2018 =
162
  * SVG icon support for post formats
163
  * Template to arrange the post details
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.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
37
  * SVG icon support for post formats
38
  * Template to arrange the post details
39
  * Premade Templates
40
+ * The Template text can be a placeholder, plain text, HTML or HTML for icons
41
  * New date format: Time since plublished
42
  * Filter by post status: Published, scheduled, private
43
  * New hover effect: SVG icon
91
 
92
  == Installation ==
93
  = Automatic installation =
94
+ Automatic installation is the easiest option as WordPress handles the file transfers itself and you dont need to leave your web browser. To do an automatic install of Category Posts Widget,
95
 
96
  1. log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
97
+ 2. In the search field type Category Posts Widget and click Search Plugins.
98
+ 3. Once youve found plugin, you can install it by simply clicking Install Now�.
99
  4. Then, go to plugins page of WordPress admin activate the plugin.
100
  5. Now, goto the Widgets page of the Appearance section and configure the Category Posts widget.
101
 
111
  * Version 3.0 or later version uses WordPress 2.9's built in post thumbnail functionality.
112
 
113
  == Frequently Asked Questions ==
114
+ = Template, placeholder and post detail =
115
+ Here You can control the [Post Detail parts](http://tiptoppress.com/category-posts-widget/documentation-4-8/#Post_details), which appears as part of the post item. All post detail will placed as placeholder. The text in the Template area can be a placeholder, plain text, HTML code or HTML code for icons.
116
 
117
+ = Use SVG icons =
118
+ For SVG icon HTML we recommend the [WordPress Dashicons](https://developer.wordpress.org/resource/dashicons/), which are included as default and can be used without any icon-font including.
119
 
120
  = How Category Posts Widget work with SiteOrigin Page Builder =
121
  Please add the widget with shortcode [catposts] inside a editor widget which is placed to a SiteOrigin Page Builder row.
149
  Check also the .htaccess file, if there is an entry for an older PHP version.
150
 
151
  == Screenshots ==
152
+ 1. Front end of the widget with SVG icon support for post formats, hover effects and the Template text-area.
153
+ 2. Template to arrange the post details with placeholders.
154
+ 3. Edit the widget options with the customizer.
155
+ 4. Use shortcode [catposts] in the content.
156
+ 5. The widget configuration dialog.
157
+ 6. Widget behaviour settings for each user.
158
 
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.1 - January 25th 2018 =
163
+ * Fixed Recognize "Empty lines" > Next line is a paragraph in the Templaste
164
+
165
  = 4.8 - January 22th 2018 =
166
  * SVG icon support for post formats
167
  * Template to arrange the post details