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…

Git aliases (updated)

Almost 2 years ago now I wrote about the Git aliases I was using.  And I still use most of them, but I’ve also added a few new ones worth talking about. Backing up slightly, I’m talking about creating shortcuts to improve your workflow.  For example, I like to use the short form of git status most of…