If you want to programmatically insert a post in the front end, for example based on user input, there is a danger that the user can resubmit the form and post it twice. WordPress has the function post_exists to prevent that. But it is an admin function and if you try using it in the […]
Continue reading...
I have discovered that the MailChimp API is pretty awful at handling audio tags when sending an email – It’ll come through looking like a playable audio player but nothing works in my email client! So I created a code snippet to turn an audio tag into a Play Audio link button…
Continue reading...
I have recently updated my Never Loose Contact form plugin for WordPress websites. I originally wrote it because I wanted a simple Spam proof contact form that saved the messages to a database, in case the emails went AWOL. In it’s first few iterations it blocked contact form messages with more than 2 hyperlinks in […]
Continue reading...
While updating a WordPress plugin recently I wanted to enable the block editor for a custom post type. Strangely, it is not automatic.After a quick Google, I discovered I needed to add ‘show_in_rest’=>true and ‘supports’=>array(‘editor’) to the arguments for the register_post_type function. All well and good, but no title field appears at the top of […]
Continue reading...
I was once with a client who changed their password for a government website to “password2016” and the website let them do it too! Thankfully, Wordpress gives you a message to warn a user that a password is weak, but it allows users to check a box to override the warning. Noooooo! I don’t want […]
Continue reading...
This evening, I rescued a client’s WordPress website from a hack that was so bad their host shut it down. I have a checklist that I use now to recover WordPress sites, which I’d like to share with you. Or you can hire me to do it for you as it requires some technical confidence! […]
Continue reading...
A local primary school wanted a parents evening booking system for their WordPress based site. It needed to be secure, but simple and easy to use. The public booking page looks like the picture below – parents click on their class to add their child’s name and choose from an available appointment. The form is […]
Continue reading...
The leading UK tax blog needed a site refresh – a clean two column layout in a red colour scheme. Richard Murphy has worked hard to expose corporate tax-avoiders, so “content is king” was the mantra for this project. Front page excerpts Comment count in a speech bubble Nested commenting for lively discussion Big headlines […]
Continue reading...
Meta Boxes are boxes that appear on the dashboard and for custom features on edit page/post pages. They can also be used in plugins too. Here’s how to create meta boxes on an admin page that will remember whether you have opened/closed them and the order you have dragged them into. They are relatively easy […]
Continue reading...
If you want your plugin to have a greater reach why not internationalise it – hopefully people will soon start translating it for you! Here’s what to do! Step 1 set up the plugin to load the translation files with this code, changing “your-plugin-name” as needed. //add localisation $my_translator_domain = ‘your-plugin-name’; $my_translator_is_setup = 0; function […]
Continue reading...