What is __return_false in filters in WordPress?

Posted by Prem Tiwari | Updated on

WordPress contains built in functions for quickly returning values.

They are intended to be used as a quick built in function that returns a common value to a filter hook such as true, false, or an empty array.

  • __return_false — Returns the Boolean value of false.
  • __return_true — Returns the Boolean value of true.
  • __return_empty_array — Returns an empty PHP array.
  • __return_zero — Returns the integer 0.
  • __return_null — Returns NULL.
  • __return_empty_string — Returns ''.

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