WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Are the fade effects on admin messages broken? (4 posts)

  1. RonStrilaeff
    Member
    Posted 1 year ago #

    I'm creating an options page for my child theme and see lots of older examples using the class="updated fade" in the message div.

    Presumably that is to make the message "fade" away, and I vaguely remember seeing some wordpress admin pages do that but they don't now (and neither does mine).

    Has that message fadeout effect been removed or deprecated?

  2. It has been removed.

    Here... and here.

    You can add it back with some jquery of your own.

  3. RonStrilaeff
    Member
    Posted 1 year ago #

    Good to know, thanks!

    So to remove the messages like this on my options/admin pages:

    echo "<div id='message' class='updated fade'><p><strong>Options Saved</strong></p></div>";

    I enqueued a little js file which includes this jQuery snippet:

    jQuery(document).ready(function($){ // doc ready wrapper.  the '$' means I can use '$' instead of 'jQuery' within this scope.
    
    $('.fade').click(function(){$(this).fadeOut('fast');}); 
    
    }); // end of doc ready wrapper

    IMHO it is better to remove the message after acknowledging it with a click instead of just an auto fadeOut. But from a UI point of view, it really should go away after *any* change is made to the page.

    Thanks again ... resolved!

  4. Yep... Perfect!!

    I agree with you. I typically like to include "dismiss" links with my admin messages. However, if you're only updating options.. I think it's a better practice to use a fade. If you are giving important information, I typically include a dismiss link.

    Either way... Glad you got it working :)

Topic Closed

This topic has been closed to new replies.

About this Topic