Tag: escape function

  • Allow HTML Tags while using an escaping function in WordPress

    Allow HTML Tags while using an escaping function in WordPress

    In WordPress, the esc_html() function is used to escape HTML entities in a string, which helps to prevent cross-site scripting (XSS) attacks. By default, this function will convert all HTML tags to their corresponding entities, including the <h1> tag. However, if you want to allow the <h1> tag in esc_html(), you can use the wp_kses()…