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...
For one of my apps, I have a landing page website – ourchurchapp.online, that detects if a mobile phone or tablet has accessed it and redirects to the correct app store. I use a javascript function to detect iOS, Android, Windows and Amazon – although Windows doesn’t go anywhere – so few people use it […]
Continue reading...
What a pain in the neck! I tried Mailhog and just couldn’t it working on my M1 Mac Mini, so I’ve gone down the Postfix route and got it working and diverting all emails to one email address. You are going to be using the Terminal (which is in Applications > Utilities) Open that up […]
Continue reading...
If you need to send a post or page out via email, you will need to parse blocks and shortcodes first. I use MailChimp and the API doesn’t like audio and video tags. This function takes the post content and parses it creating buttons for playing audio and video. In the switch($block[‘blockName’]) you can add […]
Continue reading...
If you want tables in the admin area of your plugin to be responsive, here’s the basic markup… The is-expanded class is added by the WordPress API when the downward arrow button is clicked.
Continue reading...
If weird characters suddenly appear on your blog posts and pages. Don’t panic. You may see Don’t instead of Don’t for instance. This can happen when a database is restored or updated because the character set has been changed Here are some common examples… “ = left quote = “†= right quote = ” […]
Continue reading...
If you want to follow MAMP error logs in the terminal, this the command To clear the log use this command
Continue reading...
A premium WordPress plugin client was having some trouble with their site. Some of my Javascript had stopped working because of a javascript error from another plugin/theme. Unfortunately their javascript wasn’t enqueued and I was struggling to find how it had got there. I only had site access and no FTP or shell to search. […]
Continue reading...
I often want to show a shortcode in a tutorial post without it actually processing the shortcode. For example Name EmailContact NumberSubjectMessageThis contact form only works with Javascript enabled In the old classic editor, you could switch to Text and use the html entities [ becomes [ ] becomes ] so you could use [contact_form] […]
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...