[wp-trac] [WordPress Trac] #23298: Initial gallery 'Link to' setting not applied

WordPress Trac noreply at wordpress.org
Tue Feb 5 03:29:36 UTC 2013


#23298: Initial gallery 'Link to' setting not applied
--------------------------+--------------------
 Reporter:  pokes         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.5.2
Component:  Gallery       |     Version:  3.5.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+--------------------

Comment (by helgatheviking):

 in the gallery shortcode, if you replace:

 {{{
 $link = isset($attr['link']) && 'file' == $attr['link'] ?
 wp_get_attachment_link($id, $size, false, false) :
 wp_get_attachment_link($id, $size, true, false);
 }}}

 with

 {{{
 if ( isset($attr['link']) && 'none' == $attr['link'] ) {
         $link = wp_get_attachment_image($id, $size, false, false);
 } elseif ( isset($attr['link']) && 'file' == $attr['link'] ) {
         $link = wp_get_attachment_link($id, $size, false, false);
 } else {
         $link = wp_get_attachment_link($id, $size, true, false);
 }
 }}}

 a non-linking gallery is easily accomplished.

 @krembo99 - I think a custom URL would be a lot more difficult to
 accomplish. Does every image link to the custom URL? Or does each image
 have a custom URL?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23298#comment:16>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list