HTML escaping data with ajax requests

If it is not HTML, it does not need HTML escaping, if it is not JS, it does not need JS escaping. All escaping is context based. In general You should probably just avoid sending “text” in response and focus on sending data which is “converted” into whatever is the relevant DOM structures, either directly … Read more

Using custom HTML tags to WordPress [closed]

[*] You can expand list of KSES allowed tags (and their attributes): add_filter(‘wp_kses_allowed_html’, ‘wpse_283385_blocktip_tag’); function wpse_283385_blocktip_tag($allowed_tags) { $allowed_tags[‘blocktip’] = array( ‘name’ => true, ‘id’ => true, ‘class’ => true, ‘style’ => true ); return $allowed_tags; } add_filter(‘tiny_mce_before_init’, ‘wpse_283385_blocktip_tag_tinymce’); function wpse_283385_blocktip_tag_tinymce($init) { $tags=”blocktip[*]”; if ( isset( $init[‘extended_valid_elements’] ) ) { $init[‘extended_valid_elements’].= ‘,’.$tags; } else { $init[‘extended_valid_elements’] … Read more

Unfamiliar HTML Properties in Avada and Divi Themes [closed]

These are called data attributes, which are custom attributes in the format of data-* used to attach more info to the html elements. This link here gives good examples on how to use them: https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes Example: <div id=’el’ data-my-attr=”attr_value”></div> JavaScript: Most of the time, these info are used by JavaScript to fetch data and process … Read more

Widget back end radio button issue

You got that problem because the radio buttons have different name; i.e. the_style_1 and the_style_2. So I’d suggest you to use the_style as the name for both the radio buttons: <p> <input class=”radio” type=”radio” <?php checked( $instance[ ‘the_style’ ], ‘style_1’ ); ?> id=”<?php echo $this->get_field_id( ‘the_style_1’ ); ?>” name=”<?php echo $this->get_field_name( ‘the_style’ ); ?>” value=”style_1″ … Read more

Disable File Editing function

There is no “Enable” button I’m aware of, but if you want to fully disable file editing, then that’s easy. https://codex.wordpress.org/Hardening_WordPress#Disable_File_Editing Add this line to your wp-config.php file: define(‘DISALLOW_FILE_EDIT’, true); No more file editing in WordPress.

Inline style HTML attribute is being stripped from all elements of a post

This is because what you’re trying to do trips a security feature, post content is passed through wp_kses_post to strip out dangerous tags Administrators however, have the unfiltered_html capability, which allows them to put arbitrary dangerous HTML in content and titles. This is why you’re able to insert the tags via the editor. This still … Read more

Printing HTML codes

If I understand your question well, your result shows your <hr> in text form. When you’re using esc_html__( string $text, string $domain = ‘default’ ), the returned output is escaped, it means : ” is replaced with &quot; & is replaced with &amp; < is replaced with &lt; > is replaced with &gt; So your … Read more