Set default link type to “file” for image galleries

You can override the gallery shortcode link attribute with:

add_filter( 'shortcode_atts_gallery',
    function( $out ){
        $out['link'] = 'file'; 
        return $out;
    }
);

This means that even if your shortcodes are:



the gallery output will always be generated as if you used link="file".

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)