What is the best practice to implement conditions? Within callback or wrapping the hook?
Like,
function myfunction() {
if ( get_option() ) {
// Do Something
}
}
add_action( 'hook', 'myfunction' );
Or,
function myfunction() {
// Do Something
}
if ( get_option() ) {
add_action( 'hook', 'myfunction' );
}