Earlier versions of WordPress had a blogroll, which was simply a list of links displayed next to the blog. This was disabled from V3.5, but a plugin was created to turn the functionality back on if needed (see https://codex.wordpress.org/Links_Manager). The blogroll showed on the dashboard as a ‘Links’ option, to enable you to add new links to the blogroll. The function above simply adds a link to the blogroll or modifies it, but of course that doesn’t really do anything useful, as all that is now disabled by default.
I’m guessing you didn’t actually want to add a link to the blogroll…
Instead of having a plugin, I’d like to learn how to add this myself. I want to PROGRAM it but not use it as plugin.
I wrote this part after reading, here comes to next part after I tried enabling it (it is included in the link you provided):
So my code is not changed a lot, it’s this:
<?php
// Plugin Name: Experiment
add_filter( 'pre_option_link_manager_enabled', '__return_true' );
$linkdata = array(
'link_name' => 'I"M HERE!!',
'link_url' => 'http://codex.wordpress.org'
);
wp_insert_link( $linkdata, true);
?>
I went to 127.0.0.1/prj/wp-admin/options.php. And changed link_manager_enabled. From 0 to 1. And there’s still no link.