WordPress.org

Ready to get started?Download WordPress

Forums

Add links change default target (5 posts)

  1. klausmb
    Member
    Posted 8 years ago #

    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

  2. klausmb
    Member
    Posted 8 years ago #

    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.

  3. blogtackular
    Member
    Posted 8 years ago #

    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

  4. klausmb
    Member
    Posted 8 years ago #

    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.

  5. blogtackular
    Member
    Posted 8 years ago #

    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...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags