How to add an option for “nofollow” to the Link editor’s existing “Link Relationship(XFN) options list?

Alternatively you can undo the code that disables the relationship box by re-pointing the enqueue to the xfn.js script..

First create a modified version of that script, like so..

jQuery(document).ready( function($) {
    //$('#link_rel').attr('readonly', 'readonly');
    $('#linkxfndiv input').bind('click keyup', function() {
        var isMe = $('#me').is(':checked'), inputs="";
        $('input.valinp').each( function() {
            if (isMe) {
                $(this).attr('disabled', 'disabled').parent().addClass('disabled');
            } else {
                $(this).removeAttr('disabled').parent().removeClass('disabled');
                if ( $(this).is(':checked') && $(this).val() != '')
                    inputs += $(this).val() + ' ';
            }
        });
        $('#link_rel').val( (isMe) ? 'me' : inputs.substr(0,inputs.length - 1) );
    });
});

Save as xfn.js and place into a plugin’s folder or the current theme’s folder.

NOTE: It’s a direct copy of the original(existing) script enqueued by WordPress, i’ve left original code that sets the rel input to read-only so you can see what’s been changed(one line).

Then add this to your plugin code, or theme’s functions.php, and uncomment the appropriate line in the code sample..

function switch_xfn_src( $src, $handle ) {
    if( 'xfn' == $handle )
        //$src = plugins_url( '/xfn.js', __FILE__ ); // For use inside plugin
        //$src = get_bloginfo( 'stylesheet_directory' ) . '/xfn.js'; // For use inside theme
    return $src;
}
add_filter( 'script_loader_src', 'switch_xfn_src', 10, 2 );

Job done… 🙂