Home / Attachments / Set WordPress Gallery Link to Image Default
Duplicate Snippet

Embed Snippet on Your Site

Set WordPress Gallery Link to Image Default

Override wordpress default linking to attachment page

Code Preview
php
<?php
function my_gallery_default_type_set_link( $settings ) {
    $settings['galleryDefaults']['link'] = 'file';
    return $settings;
}
add_filter( 'media_view_settings', 'my_gallery_default_type_set_link');

Comments

Add a Comment