First of all I want to tell that I am new in wordpress not very new but 2 months. My question are :-
- Is it right to use esc_attr()
and the right way as I am using is it right or not
function dr_enable_and_disable_header() { $options = get_option( 'custom_header' ); $checked = ( isset($options) && $options == 1 ? 'checked' : ''); echo '<lable><input type="' . esc_attr('checkbox') . '" id="' . esc_attr('custom_header') . '" name="' . esc_attr('custom_header') . '" value="' . esc_attr('1') . '" '. $checked .'> Activate Custom Header</lable>'; }