attachment link

attachment link

WordPress
Amitpal Singh Blog

This procedure will work for image media default linking in wordpress……
Place this in your theme’s functions.php file.

function mytheme_setup() {
 // Set default values for the upload media box
 update_option('image_default_align', 'center' );
 update_option('image_default_link_type', 'media' );
 update_option('image_default_size', 'large' );

}
add_action('after_setup_theme', 'mytheme_setup');

If you want the default link action to be none, then change this line
update_option(‘image_default_link_type’, ‘none’ );
Hope this helps and good luck

Example Image Below: