WP Gallery Custom Links - Version 1.0.2

Version Description

  • Fixed an issue with two undefined variables
Download this release

Release Info

Developer fourlightsweb
Plugin Icon wp plugin WP Gallery Custom Links
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

Files changed (2) hide show
  1. readme.txt +7 -1
  2. wp-gallery-custom-links.php +4 -4
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.fourlightsweb.com/wordpress-plugins/wp-gallery-custom-li
4
  Tags: gallery links, gallery link, gallery
5
  Requires at least: 3.3.2
6
  Tested up to: 3.3.2
7
- Stable tag: 1.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -38,6 +38,9 @@ As soon as someone asks me something. :)
38
 
39
  == Changelog ==
40
 
 
 
 
41
  = 1.0.1 =
42
  * Changed priority on post_gallery filter from 10 to 999 to help ensure it runs after anything else
43
 
@@ -46,6 +49,9 @@ As soon as someone asks me something. :)
46
 
47
  == Upgrade Notice ==
48
 
 
 
 
49
  = 1.0.1 =
50
  * Changed priority on post_gallery filter from 10 to 999 to help ensure it runs after anything else
51
 
4
  Tags: gallery links, gallery link, gallery
5
  Requires at least: 3.3.2
6
  Tested up to: 3.3.2
7
+ Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
38
 
39
  == Changelog ==
40
 
41
+ = 1.0.2 =
42
+ * Fixed an issue with two undefined variables
43
+
44
  = 1.0.1 =
45
  * Changed priority on post_gallery filter from 10 to 999 to help ensure it runs after anything else
46
 
49
 
50
  == Upgrade Notice ==
51
 
52
+ = 1.0.2 =
53
+ * Fixed an issue with two undefined variables
54
+
55
  = 1.0.1 =
56
  * Changed priority on post_gallery filter from 10 to 999 to help ensure it runs after anything else
57
 
wp-gallery-custom-links.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Gallery Custom Links
4
  Plugin URI: http://www.fourlightsweb.com/wordpress-plugins/wp-gallery-custom-links/
5
  Description: Specifiy custom links for WordPress gallery images (instead of attachment or file only).
6
- Version: 1.0.1
7
  Author: Four Lights Web Development
8
  Author URI: http://www.fourlightsweb.com
9
  License: GPL2
@@ -102,7 +102,7 @@ class WPGalleryCustomLinks {
102
 
103
  // Get the attachments for this post
104
  $post_id = intval( $post->ID );
105
- $attachments = get_children( array( 'post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ) );
106
  foreach ( $attachments as $id => $attachment ) {
107
  $link = '';
108
 
@@ -111,11 +111,11 @@ class WPGalleryCustomLinks {
111
  if( $attachment_meta ) {
112
  $link = $attachment_meta;
113
  }
114
-
115
  if( $link != '' ) {
116
  // If we have a non-blank custom url, swap out the href on the image
117
  // in the generated gallery code with the custom url
118
- if( $attr['link'] == 'file' ) {
119
  // Get file href
120
  list( $needle ) = wp_get_attachment_image_src( $id, '' );
121
  } else {
3
  Plugin Name: WP Gallery Custom Links
4
  Plugin URI: http://www.fourlightsweb.com/wordpress-plugins/wp-gallery-custom-links/
5
  Description: Specifiy custom links for WordPress gallery images (instead of attachment or file only).
6
+ Version: 1.0.2
7
  Author: Four Lights Web Development
8
  Author URI: http://www.fourlightsweb.com
9
  License: GPL2
102
 
103
  // Get the attachments for this post
104
  $post_id = intval( $post->ID );
105
+ $attachments = get_children( array( 'post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image' ) );
106
  foreach ( $attachments as $id => $attachment ) {
107
  $link = '';
108
 
111
  if( $attachment_meta ) {
112
  $link = $attachment_meta;
113
  }
114
+
115
  if( $link != '' ) {
116
  // If we have a non-blank custom url, swap out the href on the image
117
  // in the generated gallery code with the custom url
118
+ if( isset( $attr['link'] ) && $attr['link'] == 'file' ) {
119
  // Get file href
120
  list( $needle ) = wp_get_attachment_image_src( $id, '' );
121
  } else {