New Editor Window Hooks

Add a Message Above or Below the Post Editor

| 6 Comments

A couple of new hooks in WordPress 3.5 make it much simpler to hook in below both the post title box and the post editor. You can then use these functions to hook into these locations for whatever purpose you need.

In this quick example, I’m going to demonstrate how to use them to display simple messages, which can be very useful for displaying instructions on a client site, for example.

function below_the_title() {
    echo '<h3>Make sure your title is punchy and relevant to the content.</h3>';
}

add_action( 'edit_form_after_title', 'below_the_title' );
 
function below_the_editor() {
    echo '<h4>Now remember to add in your tags, categories and featured image!</h4>';
}

add_action( 'edit_form_after_editor', 'below_the_editor' );

The result of using functions like this can be seen in the screenshot below:

New Editor Window Hooks

Categories: Code & Snippets | Permalink

What next?

Hire me

If you couldn't quite manage this yourself, find it too intimidating, or just don't have the time to do it, you can always hire Dave to do it. Please get in touch so that we can discuss your needs.

Leave a comment

If you have a question, update, or comment about the tutorial, please leave a comment. I try and respond to every comment, though it may take a few days, so please check back soon.

Keep your site backed up, updated & secure

I provide a service called The WP Butler, which helps you stay on top of the maintenance of your WordPress site. Instead of worrying about whether your site is secure, updated and backed up, The WP Butler handles all that for you on a regular basis, so that you can focus on doing what you do best. If you use coupon DIWW, you'll save 15% on our already-low-prices for all maintenance plans.

Author: Dave Clements

Dave Clements has been building websites for close to a decade and in 2010, he formalised that by starting his own company, The UK Edge. He now works on a variety of web projects, from simple tasks like installing a new WordPress site, to consulting on problems, or redesigning his clients' sites. He also runs Do It With WordPress, a site dedicated to providing free tutorials on WordPress. When he's not building your new website, you can find Dave eating Wheat Thins, spending time with friends and family, watching Indie films, fostering kittens from the local Humane Society, listening to some dubstep, dance and electronic rock, and exploring the world.

6 Comments

  1. Dave I think this could be really useful for a subtitle. Could you give an example? Not sure how you would create the form element for the subtitle field and then output it in a theme.

    • That’s something else entirely. You’d need to use custom meta to save the information to the post and then output it to the theme using get_post_meta. This is simply for displaying messages (or performing other actions with the hook) above or below the editor in the dashboard only.

      • I suspected it might require a metabox but I was hoping to use this hook to place the metabox in this location.

        • Ahhh, well that you could certainly do. You might need to do some research to do it, but yes, you can use this hook to place the metabox in the desired location and then call upon that information in the theme.

  2. Very interesting. Is there a way to make it closer to the title box

Leave a Reply