opens pdf in new tab

door , admin/moderator@jakobhelmer.nl

Add this to functions.php and a pdf will open in a new tab

// opens pdf in new tab
function modify_attachment_link($markup) {
return preg_replace('/^]+)>(.*)$/', '\\2', $markup);
}
add_filter( 'wp_get_attachment_link', 'modify_attachment_link', 10, 6 );