Changeset 1142569
- Timestamp:
- 04/22/2015 08:46:23 PM (11 years ago)
- Location:
- wp-gallery-custom-links/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (4 diffs)
-
wp-gallery-custom-links.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-gallery-custom-links/trunk/readme.txt
r974761 r1142569 4 4 Tags: gallery links, gallery link, gallery 5 5 Requires at least: 3.3.1 6 Tested up to: 4. 07 Stable tag: 1.10. 16 Tested up to: 4.2 7 Stable tag: 1.10.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 134 134 images, it may affect the styling, depending on whether your stylesheet is expecting all gallery images 135 135 to have `<a>` tags around them, in which case you would need to modify your stylesheet to also apply 136 the same styles to `<img>` tags without a link around them. 136 the same styles to `<img>` tags without a link around them. 137 138 = #8) I have a lightbox/carousel set up when a user clicks an image, and I would like to make the image in the lightbox/carousel window link to the custom link. How can I accomplish this? = 139 140 Unfortunately those images are placed in those locations via your particular lightbox/carousel javascript library, 141 which this plugin isn't able to hook into to modify. You would need to modify your javascript library or theme to 142 accomplish this, which is outside the scope of this plugin. 137 143 138 144 == Screenshots == … … 141 147 142 148 == Changelog == 149 150 = 1.10.2 = 151 * Added a translation for Portuguese, courtesy of Carlos Jordão (thanks!) 152 * Added the U ungreedy modifier to regular expressions to attempt to resolve occasional not-easily-reproduced blank page issues 153 * Tested with WordPress 4.2 143 154 144 155 = 1.10.1 = … … 242 253 == Upgrade Notice == 243 254 255 = 1.10.2 = 256 * Added a translation for Portuguese, courtesy of Carlos Jordão (thanks!) 257 * Added the U ungreedy modifier to regular expressions to attempt to resolve occasional not-easily-reproduced blank page issues 258 * Tested with WordPress 4.2 259 244 260 = 1.10.1 = 245 261 * Changed javascript to queue in wp_enqueue_scripts hook instead of the all-encompassing init. -
wp-gallery-custom-links/trunk/wp-gallery-custom-links.php
r919514 r1142569 4 4 Plugin URI: http://www.fourlightsweb.com/wordpress-plugins/wp-gallery-custom-links/ 5 5 Description: Specify custom links for WordPress gallery images (instead of attachment or file only). 6 Version: 1.10. 16 Version: 1.10.2 7 7 Author: Four Lights Web Development 8 8 Author URI: http://www.fourlightsweb.com … … 302 302 $needle_parts = explode( '.wp.com', jetpack_photon_url( $needle ) ); 303 303 if( count( $needle_parts ) == 2 ) { 304 $needle_part_1 = preg_replace( '/\d+$/ ', '', $needle_parts[0] );304 $needle_part_1 = preg_replace( '/\d+$/U', '', $needle_parts[0] ); 305 305 $needle_part_2 = '.wp.com' . $needle_parts[1]; 306 306 $needle_reassembled = $needle_part_1 . $j . $needle_part_2; … … 332 332 $needle = preg_quote( $default_link ); 333 333 $needle = str_replace( '/', '\/', $needle ); 334 $needle = '/href\s*=\s*["\']' . $needle . '["\']/ ';334 $needle = '/href\s*=\s*["\']' . $needle . '["\']/U'; 335 335 if( preg_match( $needle, $output ) > 0 ) { 336 336 if( $additional_css_classes != '' ) { … … 431 431 if( preg_match( '/<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*class\s*=\s*["\'][^"\']*["\'][^>]*>/', $output ) > 0 ) { 432 432 // href comes before class 433 $output = preg_replace( '/(<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*class\s*=\s*["\'][^"\']*)(["\'][^>]*>)/ ', '$1 '.$class.'$2', $output );433 $output = preg_replace( '/(<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*class\s*=\s*["\'][^"\']*)(["\'][^>]*>)/U', '$1 '.$class.'$2', $output ); 434 434 } elseif( preg_match( '/<a[^>]*class\s*=\s*["\'][^"\']*["\'][^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*>/', $output ) > 0 ) { 435 435 // href comes after class 436 $output = preg_replace( '/(<a[^>]*class\s*=\s*["\'][^"\']*)(["\'][^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*>)/ ', '$1 '.$class.'$2', $output );436 $output = preg_replace( '/(<a[^>]*class\s*=\s*["\'][^"\']*)(["\'][^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*>)/U', '$1 '.$class.'$2', $output ); 437 437 } else { 438 438 // No previous class 439 $output = preg_replace( '/(<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*)(>)/ ', '$1 class="'.$class.'"$2', $output );439 $output = preg_replace( '/(<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*)(>)/U', '$1 class="'.$class.'"$2', $output ); 440 440 } // End if we have a class on the a tag or not 441 441 … … 451 451 if( preg_match( '/<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*target\s*=\s*["\'][^"\']*["\'][^>]*>/', $output ) > 0 ) { 452 452 // href comes before target 453 $output = preg_replace( '/(<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*target\s*=\s*["\'])[^"\']*(["\'][^>]*>)/ ', '$1'.$target.'$2', $output );453 $output = preg_replace( '/(<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*target\s*=\s*["\'])[^"\']*(["\'][^>]*>)/U', '$1'.$target.'$2', $output ); 454 454 } elseif( preg_match( '/<a[^>]*target\s*=\s*["\'][^"\']*["\'][^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*>/', $output ) > 0 ) { 455 455 // href comes after target 456 $output = preg_replace( '/(<a[^>]*target\s*=\s*["\'])[^"\']*(["\'][^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*>)/ ', '$1'.$target.'$2', $output );456 $output = preg_replace( '/(<a[^>]*target\s*=\s*["\'])[^"\']*(["\'][^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*>)/U', '$1'.$target.'$2', $output ); 457 457 } else { 458 458 // No previous target 459 $output = preg_replace( '/(<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*)(>)/ ', '$1 target="'.$target.'"$2', $output );459 $output = preg_replace( '/(<a[^>]*href\s*=\s*["\']' . $needle . '["\'][^>]*)(>)/U', '$1 target="'.$target.'"$2', $output ); 460 460 } // End if we have a class on the a tag or not 461 461
Note: See TracChangeset
for help on using the changeset viewer.