WordPress 3.5 Set Editor Height Workaround

wordpress_fix-225x225Have you recently upgraded your WordPress blog environment to 3.5? Did you happen to notice that the bottom of your editor box goes off the screen and you have to scroll down a mile to find it? Were you miffed to find out that there is no way to set the editor height in your WordPress 3.5 dashboard?

Well, if you answered “yes” to these questions then you’ll want to see what I did and you can do to fix this problem.

Let’s Hack Some PHP Code

This workaround will require editing one of the WordPress PHP code files. If your WordPress site is hosted on a service that allows you to edit your website files, then your service provider should offer you a code editor that you can use within a web browser. Using such an editor do the following:

  1. Open wp-includes/class-wp-editor.php.
  2. Search for the parse_settings() function.
  3. Scroll down to the bottom of that function until you get to this part:
    if ( $set['editor_height'] < 50 )
        $set['editor_height'] = 50;
    elseif ( $set['editor_height'] > 5000 )
        $set['editor_height'] = 5000;

    return $set;
}
  1. Now what you’ll do is explicitly set the editor height before the return statement. Select a height that works for your screen, in my case it is 400 pixels. Between lines 4 and 6 insert the line $set['editor_height'] = 400. The section from step 3 should now look like this:
    if ( $set['editor_height'] < 50 )
        $set['editor_height'] = 50;
    elseif ( $set['editor_height'] > 5000 )
        $set['editor_height'] = 5000;
    $set['editor_height'] = 400;
    return $set;
}
  1. Save the file.
  2. Reload your website browser pages so the new formatting can be seen.

That’s all there is to it. You’ll have to play with the height specified in step 4 to get the bottom of the editor box to a point with which you feel comfortable. Try this workaround and let me know if it works for you.

Author:

Article by Vic Hargrave

Software developer, blogger and family man enjoying life one cup of coffee at a time. I like programming and writing articles on tech topics. And yeah, I like coffee.

2 Comments


Leave a Reply

Your email address will not be published. Required fields are marked *