I was working on some php functions and I got confused with php syntax. Here is the function.
Is this correct? to use add_filter inside function_exists check
if ( ! function_exists( 'disable_password_reset' ) ) :
function disable_password_reset() {
return false;
}
add_filter ( 'allow_password_reset', 'disable_password_reset' );
endif;
or this one is correct, to use add_filter outside function_exists check
if ( ! function_exists( 'disable_password_reset' ) ) :
function disable_password_reset() {
return false;
}
endif;
add_filter ( 'allow_password_reset', 'disable_password_reset' );
I was working on Wordpress if that matters.
disable_password_reset, either an existing one or the newly created one (but not both).