esc_attr() right way and use
No you don’t need esc_attr() function to print out fixed static text. You only need it to print out dynamic or generated text, so that if the attributes have any special characters that may break your HTML, esc_attr will escape that properly. In your particular case, you can just write: echo ‘<label><input type=”checkbox” id=”custom_header” name=”custom_header” … Read more