• Here is a possible fix if you see all checkboxes ticked. First, go into nofollow-ner.php and change the following wp_register_script to…

    /**********************************************
    * ADD LINK DIALOGUE NOFOLLOW CHECKBOX SECTION *
    ***********************************************/
    function nofollow_redo_wplink() {
    	wp_deregister_script( 'wplink' );
    	
    	// $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    	$suffix = '';
    	
    	wp_register_script( 'wplink', plugins_url( 'wplink' . $suffix . '.js', __FILE__), array( 'jquery', 'wpdialogs' ), false, 1 );

    Next, you will need to go to the ‘wplink.js’ file in the plugin folder and change the following:

    mceRefresh: function(ed) {
    	var text,
    		selectedNode = editor.selection.getNode(),
    		linkNode = editor.dom.getParent( selectedNode, 'a[href]' ),
    		onlyText = this.hasSelectedText( linkNode );
    	if ( linkNode ) {
    		text = linkNode.innerText || linkNode.textContent;
    		inputs.url.val( ed.dom.getAttrib( linkNode, 'href' ) );
    		inputs.openInNewTab.prop( 'checked', '_blank' === editor.dom.getAttrib( linkNode, 'target' ) );
    						// Set rel="nofollow" (mod)
    		if ( "nofollow" == editor.dom.getAttrib(linkNode, 'rel' ) ) {
    			inputs.relNofollow.prop('checked', true);
    		} else {
    			// if no follow is not on on THIS linkNode, show checkbox as unchecked
    			inputs.relNofollow.prop('checked', false);
    		}
    		inputs.submit.val( wpLinkL10n.update );
    	} else {
    		text = editor.selection.getContent({ format: 'text' });
    		this.setDefaultValues();
    	}
    
    	if ( onlyText ) {
    		inputs.text.val( text || '' );
    		inputs.wrap.addClass( 'has-text-field' );
    	} else {
    		inputs.text.val( '' );
    		inputs.wrap.removeClass( 'has-text-field' );
    	}
    },

    Seems to work on my end in the classic editor.

    • This topic was modified 5 years, 10 months ago by jschofie.
  • The topic ‘Fix for all links showing ticked box’ is closed to new replies.