WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My script accesses an api to populate posts. I can add any errors to the WP_Error class, but can I add success messages to a global variable?

share|improve this question

you could test for the absence of an error and then display a success message

if(!is_wp_error( $thing )) echo "yay!!";
share|improve this answer
If you use print you can shorten it to: ! is_wp_error( $foo ) and print 'win!'; :) – toscho Feb 27 '12 at 10:12

Your Answer


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.