WordPress.org

Ready to get started?Download WordPress

Forums

Hook for help text on post fields (2 posts)

  1. mrwweb
    Member
    Posted 2 years ago #

    Is there a hook(s) I can use to append theme-specific help text to certain WordPress fields (probably in my functions.php, but maybe in a plugin file).

    For example, I might want to tell users that featured images look best when they are PNGs with transparent backgrounds.

    It just occurred to I could register an admin style that does this:

    #postimagediv .inside:after {
        content: "For best results, use PNG images with transparent backgrounds.";
        font-style: italic;
        color: #555;
    }

    But!
    1) That's a horrifically-inappropriate use of CSS and just generally hack-y.
    2) It depends on the admin markup just about never changing. That's probably a bad assumption.

    It would probably just as easy to do this with jQuery but [see the above two points replacing "CSS" with "jQuery"].

    I've googled but gotten nowhere on this one. Any help, ideas, or tips would be appreciated.

  2. Ian Dunn
    Member
    Posted 2 years ago #

    Have you looked into the new Pointers feature yet? That may be what you're looking for.

    There's also an admin_post_thumbnail_html filter that's called inside _wp_post_thumbnail_html(), so you could do something like this:

    function addFeaturedImageNote( $content )
    {
    	return $content . '<p>Tip: Featured images look best when they are PNGs with transparent backgrounds.</p>';
    }
    add_filter( 'admin_post_thumbnail_html', 'addFeaturedImageNote' );

Topic Closed

This topic has been closed to new replies.

About this Topic