If I use function_exists as following:
if ( ! function_exists( 'get_value' ) ) :
function get_value( $field ) {
..
return $value;
}
endif;
Now, when I call the function in the same file before the above function, it will give fatal error:
Fatal error: Call to undefined function get_value() ...
But, if i call it after the above function, it will return the value without any error.
Now, if I remove the function_exists condition, ie:
function get_value( $field ) {
..
return $value;
}
Then it will work if i call this function before or after in the same document. Why is this so?