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.

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
add comment

1 Answer

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
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.