Document Gallery - Version 2.3.1

Version Description

  • Bug Fix: Resolved a couple of bugs introduced with new 2.3 functionality.
Download this release

Release Info

Developer dan.rossiter
Plugin Icon 128x128 Document Gallery
Version 2.3.1
Comparing to
See all releases

Code changes from version 2.3 to 2.3.1

Files changed (3) hide show
  1. README.txt +4 -1
  2. document-gallery.php +2 -2
  3. inc/class-gallery.php +6 -10
README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: attachments, thumbnail, documents, gallery, MS office, pdf
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EE5LWRLG933EN&lc=US&item_name=Document%20Gallery%20Plugin&item_number=document%2dgallery&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
5
  Requires at least: 3.6
6
  Tested up to: 4.0.1
7
- Stable tag: 2.3
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -416,6 +416,9 @@ To see a list of features planned for the future as well as to propose your own
416
  ideas for future Document Gallery development, take a look at our
417
  [issue tracker](https://github.com/thenadz/document-gallery/issues).
418
 
 
 
 
419
  = 2.3 =
420
  * **Enhancement:** Taxonomy support now includes handling for both relationships
421
  between different taxons and relationships between different terms within a single
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EE5LWRLG933EN&lc=US&item_name=Document%20Gallery%20Plugin&item_number=document%2dgallery&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
5
  Requires at least: 3.6
6
  Tested up to: 4.0.1
7
+ Stable tag: 2.3.1
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
416
  ideas for future Document Gallery development, take a look at our
417
  [issue tracker](https://github.com/thenadz/document-gallery/issues).
418
 
419
+ = 2.3.1 =
420
+ * **Bug Fix:** Resolved a couple of bugs introduced with new `2.3` functionality.
421
+
422
  = 2.3 =
423
  * **Enhancement:** Taxonomy support now includes handling for both relationships
424
  between different taxons and relationships between different terms within a single
document-gallery.php CHANGED
@@ -5,14 +5,14 @@ defined('WPINC') OR exit;
5
  Plugin Name: Document Gallery
6
  Plugin URI: http://wordpress.org/extend/plugins/document-gallery/
7
  Description: Display non-images (and images) in gallery format on a page or post with the [dg] shortcode.
8
- Version: 2.3
9
  Author: Dan Rossiter
10
  Author URI: http://danrossiter.org/
11
  License: GPLv2
12
  Text Domain: document-gallery
13
  */
14
 
15
- define('DG_VERSION', '2.3');
16
 
17
  // define helper paths & URLs
18
  define('DG_BASENAME', plugin_basename(__FILE__));
5
  Plugin Name: Document Gallery
6
  Plugin URI: http://wordpress.org/extend/plugins/document-gallery/
7
  Description: Display non-images (and images) in gallery format on a page or post with the [dg] shortcode.
8
+ Version: 2.3.1
9
  Author: Dan Rossiter
10
  Author URI: http://danrossiter.org/
11
  License: GPLv2
12
  Text Domain: document-gallery
13
  */
14
 
15
+ define('DG_VERSION', '2.3.1');
16
 
17
  // define helper paths & URLs
18
  define('DG_BASENAME', plugin_basename(__FILE__));
inc/class-gallery.php CHANGED
@@ -405,12 +405,10 @@ class DG_Gallery {
405
  */
406
  private static function sanitizePostStatus($value, &$err) {
407
  $ret = preg_grep('/' . preg_quote($value) .'/i', self::getPostStatuses());
408
- $ret = !empty($ret) ? $ret[0] : null;
409
 
410
- if(is_null($ret)) {
411
- $err = sprintf(
412
- __(self::$unary_err, 'post_status', $value, 'document-gallery'),
413
- $value);
414
  }
415
 
416
  return $ret;
@@ -438,12 +436,10 @@ class DG_Gallery {
438
  */
439
  private static function sanitizePostType($value, &$err) {
440
  $ret = preg_grep('/' . preg_quote($value) .'/i', self::getPostTypes());
441
- $ret = !empty($ret) ? $ret[0] : null;
442
 
443
- if(is_null($ret)) {
444
- $err = sprintf(
445
- __(self::$unary_err, 'post_type', $value, 'document-gallery'),
446
- $value);
447
  }
448
 
449
  return $ret;
405
  */
406
  private static function sanitizePostStatus($value, &$err) {
407
  $ret = preg_grep('/' . preg_quote($value) .'/i', self::getPostStatuses());
408
+ $ret = reset($ret);
409
 
410
+ if($ret === false) {
411
+ $err = sprintf(self::$unary_err, 'post_status', $value);
 
 
412
  }
413
 
414
  return $ret;
436
  */
437
  private static function sanitizePostType($value, &$err) {
438
  $ret = preg_grep('/' . preg_quote($value) .'/i', self::getPostTypes());
439
+ $ret = reset($ret);
440
 
441
+ if($ret === false) {
442
+ $err = sprintf(self::$unary_err, 'post_type', $value);
 
 
443
  }
444
 
445
  return $ret;