what to do with a WP Error Object

Posted by Prem Tiwari | Updated on
  1. Assign return of the function to the variable.
  2. Check the variable with is_wp_error().
  3. If true handle accordingly, for example trigger_error() with message from WP_Error->get_error_message() method.
  4. If false – proceed as usual.

Usage:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers