I was thinking of removing/hiding admin-bar from my wordpress (3.1.1) installation.

I visited following link:

http://codex.wordpress.org/Plugin_API/Filter_Reference/show_admin_bar

I was surprised to see only a single line to remove/hide admin-bar

add_filter( 'show_admin_bar', '__return_false' );

My question is what is __return_false means? why __ and _?

1

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

Leave a Reply

Your email address will not be published. Required fields are marked *