Sending HTML emails in WordPress

Sounds simple, but WordPress defaults to text emails, so if you want to send pretty HTML ones, then you need to let it know. Previously I have done this in a bit of a convoluted way… add_filter(‘wp_mail_content_type’,’set_html_mail_content_type’); wp_mail($to_address, $subject, $message); remove_filter(‘wp_mail_content_type’,’set_html_mail_content_type’); This relies on this function to work… function set_html_mail_content_type() { return ‘text/html’; } You…

Updating WordPress post metadata

I was fighting with a WordPress issue earlier today, and the solution turned out to be pretty simple, and a clear case of me not reading the WordPress developer resources properly. The situation arose because I was updating a number of post metadata fields and trying to count the number of edits, like this… $count…

Creating a WP_Error

I’m working on a new WordPress plugin at the moment, one to take advantage of the hCaptcha service.  hCaptcha is a drop-in replacement for Google’s reCaptcha, so it keeps bots (and other non-humans) from posting forms on your website. There are a few benefits to using hCaptcha over reCaptcha though… Privacy focused – unlike everything that Google…