Created
December 10, 2018 00:19
-
-
Save hachesilva/490605c2f7444daf6e4e9c5c3e0da1f6 to your computer and use it in GitHub Desktop.
How to Automatically Remove Default Image Links in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Source: https://www.wpbeginner.com/wp-tutorials/automatically-remove-default-image-links-wordpress/ | |
// functions.php | |
function wpb_imagelink_setup() { | |
$image_set = get_option( 'image_default_link_type' ); | |
if ($image_set !== 'none') { | |
update_option('image_default_link_type', 'none'); | |
} | |
} | |
add_action('admin_init', 'wpb_imagelink_setup', 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment