Created
December 2, 2015 21:36
-
-
Save 2ndkauboy/09fffc2df507528cd19b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Deactivate Full Size Image Links | |
* Description: Deactivates the links to the media file when using the full site image in a gallery shortcode | |
* Version: 1.0.0 | |
* Author: Bernhard Kau | |
* Author URI: https://kau-boys.de | |
* License: GPLv3 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0 | |
*/ | |
/** | |
* Deactivate the links if the gallery shortcode when using the "full" size images | |
* | |
* @param array $out The output array of shortcode attributes. | |
* @param array $pairs The supported attributes and their defaults. | |
* @param array $atts The user defined shortcode attributes. | |
*/ | |
function deactivate_image_link_on_full_size( $out, $pairs, $atts ) { | |
if ( 'full' == $atts[ 'size' ] ) { | |
$out[ 'link' ] = 'none'; | |
} | |
return $out; | |
} | |
add_action( 'shortcode_atts_gallery', 'deactivate_image_link_on_full_size', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment