You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__( 'Sorry, no matching posts were found. Your query may be too restrictive. Please check your shortcode implementation.', 'random-post-on-refresh' )
193
+
__( 'Sorry, no matching posts were found. Your query may be too restrictive. Please check your shortcode implementation.', 'random-post-on-refresh' ) .
194
+
( $image_required ? '' . __( 'Currently, only posts with featured images will be shown. Perhaps try setting the "image_required" property to "false"?', 'random-post-on-refresh' ) : '' )
190
195
);
191
196
}
192
197
@@ -199,7 +204,7 @@ function ( $group ) {
199
204
*/
200
205
$post = $posts[ array_rand( $posts ) ];
201
206
202
-
if ( $show_image && ! has_post_thumbnail( $post ) ) {
@@ -57,6 +57,8 @@ The `[random_post_on_refresh]` shortcode supports a few attributes to give you m
57
57
58
58
* **ids** - Provide a comma-separated list of post IDs to pull random posts from. Example: `[random_post_on_refresh ids="19, 87, 113, 997"]`
59
59
60
+
* **image_required** - Only applies when the `show` attribute contains `image`. This attribute defaults to `true` and will cause WordPress to filter out any posts without images. If set to `false`, then posts with or without images will be shown. Example: `[random_post_on_refresh show="title, image" image_required="false"]`
61
+
60
62
* **not** - Provide a comma-separated list of post IDs to exclude. Example: `[random_post_on_refresh not="3, 456, 876"]`
61
63
62
64
* **post_type** - Provide a post type or a comma-separated list of post types to pull from. You must use the internal post type name. Default is `post`. Example: `[random_post_on_refresh post_type="page"]`
@@ -77,6 +79,11 @@ Keep in mind that any of these attributes can be combined as needed. Example: `
77
79
78
80
== Changelog ==
79
81
82
+
= 1.2 =
83
+
84
+
* Added a shortcode attribute to allow posts without images to be shown when the `show` attribute contains `image`.
85
+
* Bug fix for certain strings not being translatable.
86
+
80
87
= 1.1.1 =
81
88
82
89
* Fixed bug where post excerpts were being generated incorrectly.
@@ -102,3 +109,7 @@ Keep in mind that any of these attributes can be combined as needed. Example: `
102
109
103
110
* Bug fix for how post excerpts are generated. Tested with WordPress 5.2.3.
0 commit comments