• Hi there is there someway I can alter the wordpress install so that each time I add a new link via the link manage the default Target selection is _blank so I don’t need to check this everytime I add a new link. Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter klausmb

    (@klausmb)

    Anyone? I have looked at wp-admin/edit-link-form.php and found the relevant lines but just not sure how to make _blank the checked radio button.

    If you just take the line in edid-link form.php that creates the is_blank button, and move it below the ‘none’ button, t works fine.
    <input type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
    <code>_top</code></label><br />
    <label>
    <input type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
    <?php _e('none') ?></label><br />
    <input type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
    <code>_blank</code></label><br />
    <?php _e('(Note that the <code>target</code> attribute is illegal in XHTML 1.1 and 1.0 Strict.)') ?>

    Is what you need it too look like

    Thread Starter klausmb

    (@klausmb)

    Thanks for the reply, the code above however just alters the order the radiobuttons are drawn to screen, the none options is still the default selected, I want the _blank radiobutton selected. I think perhaps which is selected is set from one of the arrays further up the php page? or maybe it is database driven I don’t know.

    The default is the last radio button called, which is why the above should work (it does for me at least)… not entirely sure why it doesn’t for you…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add links change default target’ is closed to new replies.