How to escape html code with html allowed
You are looking for wp_kses(). https://developer.wordpress.org/reference/functions/wp_kses/ There are more helper functions like wp_kses_post() and wp_kses_data()
You are looking for wp_kses(). https://developer.wordpress.org/reference/functions/wp_kses/ There are more helper functions like wp_kses_post() and wp_kses_data()
Try this one. add_filter( ‘wp_mail_content_type’, ‘wpdocs_set_html_mail_content_type’ ); $to = ‘[email protected]’; $subject=”The subject”; $body = ‘The email body content’; $headers = array(‘Content-Type: text/html; charset=UTF-8’); wp_mail( $to, $subject, $body , $headers); // Reset content-type to avoid conflicts — https://core.trac.wordpress.org/ticket/23578 remove_filter( ‘wp_mail_content_type’, ‘wpdocs_set_html_mail_content_type’ ); function wpdocs_set_html_mail_content_type() { return ‘text/html’; }
Many evil things can be done by including an image. The question is how well WordPress filters them. To give you an idea: File names should be checked properly. The actual image data can contain javascript. Also, EXIF data could contain javascript.
I am using the plugin AddQuicktag from @bueltge in some blogs to create a separate <i> button: That creates a nice little button with the text i!, and WordPress will not touch it.
WordPress Core does not support converting DOC files into posts. You might want to look at the range of importers that are available: Importing Content (WordPress Codex). However the concept to import text into one blog post looks like a refreshing new concept to wordpress, core does not support anything at all of that. Basically … Read more
If you’re willing to create a child theme and put your PHP files in there, this approach is relatively clean. For each file, create a rewrite rule where you specify the path you want to use and the filename that should load. In the example below, /custom-path/ loads custom-file.php from the root of your child … Read more
You can use output buffering to accomplish this. Add a high priority hook directly before the template is rendered: add_action(‘template_redirect’, ‘foo_buffer_go’, 0); function foo_buffer_go(){ ob_start(‘foo_buffer_callback’); } Add a shutdown hook with an extremely low priority. add_action(‘shutdown’, ‘foo_buffer_stop’, 1000); function foo_buffer_stop(){ ob_end_flush(); } Inside your callback, you manipulate the rendered HTML. function foo_buffer_callback($buffer){ //Do something with … Read more
Well, it is the same form, but it is moved to another place in the DOM tree. So you could create one style for just .comments #respond, and one for .comments .comment #respond for the moved reply form.
WordPress is running addslashes on POST input. The value you get from the data base looks probably like: <img title=\”\” … … and the editor tries to enforce valid markup from that. So … call the editor with … wp_editor( stripslashes( $content ), strtolower($value[‘id’]), $settings );
The value for that string is normally taken from the option WPLANG in your database table $prefix_options. You can set it in the backend under Settings/General (wp-admin/options-general.php) or per SQL. There several ways to change that value per PHP: Create a global variable $locale in your wp-config.php: $locale=”en_GB”; Declare the constant WPLANG in your wp-config.php: … Read more