Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i'm writing some custom wordpress pages, and i want that after an action where the user has addess an item to a list (after the user press the submit button and the page reloads showing the updated list) a messagge appears on top of the content area saying something like "the item xxxxxxx has been added." and then fades away after a couple of seconds (or it could stay with an "x" to the right to close it).

There is any function in Wordpress that allows meto do that? The fading is optional, but i want to give the customer some kind of feedback (maybe in a green-border on white box or something like that).

Also optional but interesting would be to have also the error message, all the same just red border instead of green.

The message has to show inside the page, not over and has not to be modal nor an js alert.

share|improve this question
    
Search for "admin notice" (there's a hook also). –  kaiser Oct 16 '11 at 19:32
add comment

1 Answer

up vote 3 down vote accepted

WordPress makes use of add_settings_error() and related function to setup notifications to display.

Using them is not very straightforward, so easier way might be to make use of hooks like admin_notices or all_admin_notices to output your own message and style it in same way as WP does.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.