Version Description
- Fix: Use WP_Query to get galleries when cache/transient is empty, preventing gallery output blanking after a day when using caching plugins
Download this release
Release Info
Developer | n7studios |
Plugin | Photo Gallery by Envira – Responsive Image Gallery for WordPress |
Version | 1.3.5.5 |
Comparing to | |
See all releases |
Code changes from version 1.3.5.4 to 1.3.5.5
- envira-gallery-lite.php +10 -9
- readme.txt +3 -0
envira-gallery-lite.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
|
6 |
* Author: Thomas Griffin
|
7 |
* Author URI: http://thomasgriffinmedia.com
|
8 |
-
* Version: 1.3.5.
|
9 |
* Text Domain: envira-gallery-lite
|
10 |
*
|
11 |
* Envira Gallery is free software: you can redistribute it and/or modify
|
@@ -53,7 +53,7 @@ class Envira_Gallery_Lite {
|
|
53 |
*
|
54 |
* @var string
|
55 |
*/
|
56 |
-
public $version = '1.3.5.
|
57 |
|
58 |
/**
|
59 |
* Unique plugin slug identifier.
|
@@ -287,27 +287,28 @@ class Envira_Gallery_Lite {
|
|
287 |
*/
|
288 |
public function _get_galleries() {
|
289 |
|
290 |
-
$galleries =
|
291 |
array(
|
292 |
'post_type' => 'any',
|
293 |
-
'
|
294 |
-
'
|
295 |
-
'nopaging' => true,
|
296 |
'fields' => 'ids',
|
297 |
'meta_query' => array(
|
298 |
array(
|
299 |
-
'key' => '_eg_gallery_data'
|
|
|
300 |
)
|
301 |
)
|
302 |
)
|
303 |
);
|
304 |
-
|
|
|
305 |
return false;
|
306 |
}
|
307 |
|
308 |
// Now loop through all the galleries found and only use galleries that have images in them.
|
309 |
$ret = array();
|
310 |
-
foreach ( $galleries as $id ) {
|
311 |
$data = get_post_meta( $id, '_eg_gallery_data', true );
|
312 |
if ( empty( $data['gallery'] ) ) {
|
313 |
continue;
|
5 |
* Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
|
6 |
* Author: Thomas Griffin
|
7 |
* Author URI: http://thomasgriffinmedia.com
|
8 |
+
* Version: 1.3.5.5
|
9 |
* Text Domain: envira-gallery-lite
|
10 |
*
|
11 |
* Envira Gallery is free software: you can redistribute it and/or modify
|
53 |
*
|
54 |
* @var string
|
55 |
*/
|
56 |
+
public $version = '1.3.5.5';
|
57 |
|
58 |
/**
|
59 |
* Unique plugin slug identifier.
|
287 |
*/
|
288 |
public function _get_galleries() {
|
289 |
|
290 |
+
$galleries = new WP_Query(
|
291 |
array(
|
292 |
'post_type' => 'any',
|
293 |
+
'posts_per_page'=> -1,
|
294 |
+
'post_status' => 'publish',
|
|
|
295 |
'fields' => 'ids',
|
296 |
'meta_query' => array(
|
297 |
array(
|
298 |
+
'key' => '_eg_gallery_data',
|
299 |
+
'compare' => 'EXISTS',
|
300 |
)
|
301 |
)
|
302 |
)
|
303 |
);
|
304 |
+
|
305 |
+
if ( ! isset( $galleries->posts) || empty( $galleries->posts ) ) {
|
306 |
return false;
|
307 |
}
|
308 |
|
309 |
// Now loop through all the galleries found and only use galleries that have images in them.
|
310 |
$ret = array();
|
311 |
+
foreach ( $galleries->posts as $id ) {
|
312 |
$data = get_post_meta( $id, '_eg_gallery_data', true );
|
313 |
if ( empty( $data['gallery'] ) ) {
|
314 |
continue;
|
readme.txt
CHANGED
@@ -57,6 +57,9 @@ Also, I'm an <a href="https://thomasgriffin.io" rel="me" title="WordPress Develo
|
|
57 |
|
58 |
== Changelog ==
|
59 |
|
|
|
|
|
|
|
60 |
= 1.3.5.4 =
|
61 |
* Fix: Gallery slug would not save when changed
|
62 |
|
57 |
|
58 |
== Changelog ==
|
59 |
|
60 |
+
= 1.3.5.5 =
|
61 |
+
* Fix: Use WP_Query to get galleries when cache/transient is empty, preventing gallery output blanking after a day when using caching plugins
|
62 |
+
|
63 |
= 1.3.5.4 =
|
64 |
* Fix: Gallery slug would not save when changed
|
65 |
|