Ultimate Posts Widget - Version 2.0.6

Version Description

  • Fix PHP notice (thanks @rhyswynne)
  • Search custom template both in child theme and in parent (thanks @groucho75)
Download this release

Release Info

Developer bostondv
Plugin Icon wp plugin Ultimate Posts Widget
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

readme.md → README.md RENAMED
@@ -107,6 +107,10 @@ This plugin uses the [timthumb library](http://www.binarymoon.co.uk/projects/tim
107
 
108
  ## Changelog
109
 
 
 
 
 
110
  ### 2.0.5
111
  * Adds menu order sort by option
112
 
107
 
108
  ## Changelog
109
 
110
+ ### 2.0.6
111
+ * Fix PHP notice (thanks @rhyswynne)
112
+ * Search custom template both in child theme and in parent (thanks @groucho75)
113
+
114
  ### 2.0.5
115
  * Adds menu order sort by option
116
 
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "bostondv/ultimate-posts-widget",
3
- "version": "2.0.5",
4
  "contributors": [
5
  "Boston Dell-Vandenberg <boston@pomelodesign.com>"
6
  ],
1
  {
2
  "name": "bostondv/ultimate-posts-widget",
3
+ "version": "2.0.6",
4
  "contributors": [
5
  "Boston Dell-Vandenberg <boston@pomelodesign.com>"
6
  ],
readme.txt CHANGED
@@ -1,18 +1,18 @@
1
  === Ultimate Posts Widget ===
2
  Contributors: bostondv
3
- Donate link: http://www.pomelodesign.com/donate/
4
  License: MIT
5
  License URI: http://opensource.org/licenses/MIT
6
  Tags: widget, recent posts, custom post types, sticky posts, featured image, post thumbnail, excerpts, category, custom fields, list pages, widget query, microformats, customizable widget, categories widget, tags widget, excerpt, widget templates, post author, post date, custom query, ultimate posts, comments, orderby, comment count
7
  Requires at least: 3.5
8
- Tested up to: 4.3
9
- Stable tag: 2.0.5
10
 
11
  The ultimate widget for displaying posts, custom post types or sticky posts with an array of options.
12
 
13
  == Description ==
14
 
15
- The ultimate widget for displaying posts, custom post types or sticky posts with an array of options to customize the display.
16
 
17
  Designed for both the average user and developer, Ultimate Posts Widgets aims to provide flexibility and ease of use for displaying any kinds of posts within your widget areas. An array of widget options are available as well as hooks, filters and custom templates for more advanced customization.
18
 
@@ -49,13 +49,14 @@ See the [FAQ tab](https://wordpress.org/plugins/ultimate-posts-widget/faq/) for
49
 
50
  * For help use [wordpress.org](http://wordpress.org/support/plugin/ultimate-posts-widget/)
51
  * Fork or contribute on [Github](https://github.com/bostondv/ultimate-posts-widget/)
52
- * Visit [our website](http://pomelodesign.com/) for more
53
  * Follow me on [Twitter](http://twitter.com/bostondv/)
54
  * View my other [WordPress Plugins](http://profiles.wordpress.org/bostondv/)
55
 
 
 
56
  = Support =
57
 
58
- Did you enjoy this plugin? Please [donate to support ongoing development](http://pomelodesign.com/donate/). Your contribution would be greatly appreciated.
59
 
60
  == Frequently Asked Questions ==
61
 
@@ -79,7 +80,7 @@ As of version 2.0.0 we changed the widget HTML markup. For installs prior to 2.0
79
  The new standard template as of version 2.0.0. It features better HTML5 markup, improved styling on various themes without the need for custom CSS, and hfeed microformat.
80
 
81
  **custom**
82
- As of version 2.0.0 you can now provide your own custom template files. To do this, create a directory named `upw` in your theme and copy a template from the plugin's `templates` directory. Edit as needed.
83
 
84
  Then, in the widget settings under the *Display* tab, choose *Custom* from the *Template* drop down. In the *Custom Template Name* field that appears and enter the file name of your template (excluding .php). For example, if your template is named `custom.php` then enter `custom` in the *Custom Template Name* field.
85
 
@@ -123,6 +124,10 @@ This plugin uses the [timthumb library](http://www.binarymoon.co.uk/projects/tim
123
 
124
  == Changelog ==
125
 
 
 
 
 
126
  = 2.0.5 =
127
  * Adds menu order sort by option
128
 
1
  === Ultimate Posts Widget ===
2
  Contributors: bostondv
3
+ Donate link: http://bostondv.com/tips/
4
  License: MIT
5
  License URI: http://opensource.org/licenses/MIT
6
  Tags: widget, recent posts, custom post types, sticky posts, featured image, post thumbnail, excerpts, category, custom fields, list pages, widget query, microformats, customizable widget, categories widget, tags widget, excerpt, widget templates, post author, post date, custom query, ultimate posts, comments, orderby, comment count
7
  Requires at least: 3.5
8
+ Tested up to: 4.8
9
+ Stable tag: 2.0.6
10
 
11
  The ultimate widget for displaying posts, custom post types or sticky posts with an array of options.
12
 
13
  == Description ==
14
 
15
+ The ultimate widget for displaying posts, custom post types or sticky posts with an array of options to customize the display.
16
 
17
  Designed for both the average user and developer, Ultimate Posts Widgets aims to provide flexibility and ease of use for displaying any kinds of posts within your widget areas. An array of widget options are available as well as hooks, filters and custom templates for more advanced customization.
18
 
49
 
50
  * For help use [wordpress.org](http://wordpress.org/support/plugin/ultimate-posts-widget/)
51
  * Fork or contribute on [Github](https://github.com/bostondv/ultimate-posts-widget/)
 
52
  * Follow me on [Twitter](http://twitter.com/bostondv/)
53
  * View my other [WordPress Plugins](http://profiles.wordpress.org/bostondv/)
54
 
55
+ Made with <3 by [Boston Dell-Vandenberg](http://bostondv.com).
56
+
57
  = Support =
58
 
59
+ Did you enjoy this plugin? Please [donate to support ongoing development](http://bostondv.com/tips/). Your contribution would be greatly appreciated.
60
 
61
  == Frequently Asked Questions ==
62
 
80
  The new standard template as of version 2.0.0. It features better HTML5 markup, improved styling on various themes without the need for custom CSS, and hfeed microformat.
81
 
82
  **custom**
83
+ As of version 2.0.0 you can now provide your own custom template files. To do this, create a directory named `upw` in your theme and copy a template from the plugin's `templates` directory. Edit as needed.
84
 
85
  Then, in the widget settings under the *Display* tab, choose *Custom* from the *Template* drop down. In the *Custom Template Name* field that appears and enter the file name of your template (excluding .php). For example, if your template is named `custom.php` then enter `custom` in the *Custom Template Name* field.
86
 
124
 
125
  == Changelog ==
126
 
127
+ = 2.0.6 =
128
+ * Fix PHP notice (thanks @rhyswynne)
129
+ * Search custom template both in child theme and in parent (thanks @groucho75)
130
+
131
  = 2.0.5 =
132
  * Adds menu order sort by option
133
 
ultimate-posts-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ultimate Posts Widget
4
  Plugin URI: http://wordpress.org/plugins/ultimate-posts-widget/
5
  Description: The ultimate widget for displaying posts, custom post types or sticky posts with an array of options.
6
- Version: 2.0.5
7
  Author: Boston Dell-Vandenberg
8
  Author URI: http://pomelodesign.com
9
  Text Domain: upw
@@ -64,7 +64,12 @@ if ( !class_exists( 'WP_Widget_Ultimate_Posts' ) ) {
64
  function widget( $args, $instance ) {
65
 
66
  global $post;
67
- $current_post_id = $post->ID;
 
 
 
 
 
68
 
69
  $cache = wp_cache_get( 'widget_ultimate_posts', 'widget' );
70
 
@@ -182,8 +187,8 @@ if ( !class_exists( 'WP_Widget_Ultimate_Posts' ) ) {
182
 
183
  if ($instance['template'] === 'custom') {
184
  $custom_template_path = apply_filters('upw_custom_template_path', '/upw/' . $instance['template_custom'] . '.php', $instance, $this->id_base);
185
- if (locate_template($custom_template_path)) {
186
- include get_stylesheet_directory() . $custom_template_path;
187
  } else {
188
  include 'templates/standard.php';
189
  }
3
  Plugin Name: Ultimate Posts Widget
4
  Plugin URI: http://wordpress.org/plugins/ultimate-posts-widget/
5
  Description: The ultimate widget for displaying posts, custom post types or sticky posts with an array of options.
6
+ Version: 2.0.6
7
  Author: Boston Dell-Vandenberg
8
  Author URI: http://pomelodesign.com
9
  Text Domain: upw
64
  function widget( $args, $instance ) {
65
 
66
  global $post;
67
+
68
+ if ( is_object( $post ) ) {
69
+ $current_post_id = $post->ID;
70
+ } else {
71
+ $current_post_id = 0;
72
+ }
73
 
74
  $cache = wp_cache_get( 'widget_ultimate_posts', 'widget' );
75
 
187
 
188
  if ($instance['template'] === 'custom') {
189
  $custom_template_path = apply_filters('upw_custom_template_path', '/upw/' . $instance['template_custom'] . '.php', $instance, $this->id_base);
190
+ if ( $template = locate_template($custom_template_path) ) {
191
+ include $template;
192
  } else {
193
  include 'templates/standard.php';
194
  }