Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Class Reference/WP Error

Error Codes

The documentation for the constructor is confusing and missing necessary detail. What is the meaning of the $code value? Should I just make up numbers, or is there a fixed list I should refer to? Are there constants for $code? Also, it says that if $code is not empty then $message "will be used". What does that mean? Used how? Mslade (talk) 19:02, 4 November 2015 (UTC)


I've updated the page to explain this better. -Jdgrimes (talk) 20:32, 4 November 2015 (UTC)

Code is Difficult to Document

I wonder

  • why not create a single file for the error-class? Having multiple classes in one classes.php is annoying if one is searching for code!
  • why is there only one single line of inline-doc? It would have been so easy do document this file when writing it... Inline-Documentation has many advantages over what we can do in the codex here. First of all it is less likely to be outdated...

I think that both of these issues have been fixed now, thankfully. -Jdgrimes (talk) 20:32, 4 November 2015 (UTC)