Set default add image link in WordPress.
<?php
function ccd_default_image_link() {
$image_set = get_option( 'image_default_link_type' );
if ($image_set !== 'file') { // Could be 'none'
update_option( 'image_default_link_type', 'file' );
}
}
add_action( 'admin_init', 'ccd_default_image_link', 10 );
?>
WordPress Snippet
Choose the default link when adding an image to a post.