Upgraded WordPress 2.01

On 13-Feb-2006, in tips and tutorials, by Martin

Stepping list So I took an awfull risk this evening in upgrading to WordPress 2.01. I forgot to deactivate my plugins. I forgot to backup my mysql database. And to my surprise… It worked like a charm. Database is upgraded aswell. WP asked about that. Just one tiny step and we were up and running [...]

Stepping list

So I took an awfull risk this evening in upgrading to WordPress 2.01. I forgot to deactivate my plugins. I forgot to backup my mysql database. And to my surprise… It worked like a charm. Database is upgraded aswell. WP asked about that. Just one tiny step and we were up and running again.

Please please I urge you

Do not do this at home!
Read this first when you are upgrading from a previous version! Or this publication if you are a newbie. Print it out if you have to because I was on the brink for a total melt-down here. Fortunately nothing shocking happened. Pffff.

At first glance

To be frank I do not notice a bit of difference. But as they say… Over 114 issues are solved. Gone, history! Congratulations go to the WP-team! Hear, hear!

You can download the new offspring here.

Alterations

  • I adjusted a thingy or 2 in “wp-comments-post.php”. Look for this line;
    if ( get_settings(‘require_name_email’) && !$user_ID ) {

    It bothered me when someone could (by accident) hit the button and got an error announcement without a proper link-back. So I added some in the error-trap here. Like so:

    if ( get_settings(‘require_name_email’) && !$user_ID ) {
    if ( 6 > strlen($comment_author_email) || ” == $comment_author )
     
    die( __(‘<span style="font-family: verdana;font-size: medium;color:
    #808080;">Error: please fill the required fields (name, email).</span>
    <form><input type="button" onclick="history.go(-1)" class="button" name="back"
    value="&laquo; back" /></form>’) );
    elseif ( !is_email($comment_author_email))
    die( __(‘<span style="font-family: verdana;font-size: medium;color:
    #808080;">Error: please enter a valid email address.</span></span> <form><input
    type="button" onclick="history.go(-1)" class="button" name="back" value="&laquo;
    back" /></form>’) );
    }
    if ( ” == $comment_content )
    die( __(‘<span style="font-family: verdana;font-size: medium;color:
    #808080;">Error: please type a comment.</span> <form><input type="button"
    onclick="history.go(-1)" class="button" name="back" value="&laquo; back"
    /></form>’) );

    You can find the code between lines 39 and 48 approx. But watch out! Make a copy (i.e. backup) first, then edit.

  • Do you find the textarea also quite small? Edit file “edit-form-advanced.php” in the wp-admin directory. Look for these lines:
    <?php
    $rows = get_settings(‘default_post_edit_rows’);
    if (($rows < 3) || ($rows > 100)) {
    $rows = 30;
    }
    ?>

    At line 160 approx. You can alter the $rows value to 30 like I did. If this doesn’t work for you can also alter the next line were it says

    rows="<?php echo $rows; ?>"

    and edit it into this:

    rows="30"

    Nice huh?

  • Something I missed in the standard editor aswell was an extra button for putting in paragraphs. So I added a button. Open up “quicktags.js” in the wp-includes/js directory. Somewere between lines 44 and 50 you see this (it really doesn’t matter all that much were as long as the sections remain intact)
    edButtons[edButtons.length] =
    new edButton(‘ed_em’
    ,’i’
    ,’<em>’
    ,’</em>’
    ,’i’
    );

    Add another section with this

    // Added by Me
    edButtons[edButtons.length] =
    new edButton(‘ed_par’
    ,’&#182;’
    ,’<p>’
    ,’</p>’
    ,’y’
    );
    // end editing

    So that it looks like this

    edButtons[edButtons.length] =
    new edButton(‘ed_em’
    ,’i’
    ,’<em>’
    ,’</em>’
    ,’i’
    );
    // Added by Mart
    edButtons[edButtons.length] =
    new edButton(‘ed_par’
    ,’&#182;’
    ,’<p>’
    ,’</p>’
    ,’y’
    );
    // end editing

    And you are done!

Cheers until next time!

 

Leave a Reply

WordPress Blog

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

WordPress主题