I’ve been banging my head against the wall for background Android notifications for a longtime. They just were not re-opening the app, when tapped. I’m using cordova-plugin-firebasex. To get them to work, you need to edit AndroidManifest.xml and change this line To this…. You also need ‘click_action’:’MYCLICKACTIVITY’ in the android > notification json sent to […]
Continue reading...
With the advent of block and patterns in themes, the ability for plugins to prepend some content on posts and pages has got a little more complicated. The old method of filtering the content, doesn’t look good as a quirk is that filter hook is fired at the top of the page or post. Ouch. […]
Continue reading...
WordPress ships with the Farbtastic color picker, which is great if you want users to be able to select a colour. For a recent plugin I wanted users to be able to select a background colour of a div, but I also needed the text colour to work – that also needed to change automatically […]
Continue reading...
When you create content for a podcast for iTunes, Amazon Music and Spotify, the xml feed requires the length of the MP3 – that can be a problem if you are using an external mp3 file. It’s not easy to use the PHP get_id3 libraries to determine the length. If you can get them to […]
Continue reading...
Just once in a while, you can’t get into the WordPress dashboard and you need to create a new admin user quickly. You can do it with PHPMyAdmin. Login to PHPMyadmin Goto your WordPress Database table and click on SQL. Then copy and paste the MySQL statements below. Change YOUR USERNAME, PASSWORD, Your Username and […]
Continue reading...
A client wanted a glossary of terms on a WordPress site and was looking for automated links of glossary entries. Trouble is each “needle” could be a word/phrase on its own (or in brackets and with punctuatin), or a word/phrase in an anchor tag or img tag. Nightmare! str_replace and the case-insensitive str-ireplace just won’t […]
Continue reading...
In the Google Chrome Browser Open Developer tools with right click and “Inspect” Open the Command Control: <ctrl><shift><p> (Windows) or <cmd><shift><p> Type “Show rendering” Set theĀ Emulate CSS media feature prefers-color-schemeĀ to the value you want to debug While you are here, have some CSS…
Continue reading...
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...