How to exchange data from PHP to JavaScript in WordPress
I was involved in writing a small plugin project last week, for which I found myself reading a database value from WordPress (in PHP) that I wanted to use in JavaScript. I don’t do much in JavaScript and it had occurred to me that I had no idea how I should exchange the data. After some digging I found several posts on this subject, and I found the most straightforward one was by Toby Osbourn. He made me aware of the wp_localize_script() function and gives a brief example. Thanks, Toby! The function is designed to over localised values...
read moreHow to find your Followers on Twitch
Twitch is a little weird in that it doesn’t provide a menu accessible link to a list of your current followers (as of April 2019). After all, if you’ve had a nice conversation with somebody, and you’d like to see when they’re live next, you may want to follow a follower. Thankfully though, there’s a quick URL hack that’ll show us just the same. Amend this: https://twitch.tv/user/followers where user is your user name. You may need to be logged in for this list to come up properly. For example, you can see...
read moreHow to connect from your Mac to your Windows 10 Computer
Networking sucks, particularly when Windows is involved. I’m not actually sure why, but I guess it has to do with the fact that deep down, manufacturers and software developer really don’t want us to connect arbitrary devices to suit our needs. It’s just a fact of technological survival I guess. I’ve recently re-installed Windows on my desktop, and now my Mac cannot connect to Windows anymore. I had to set this up again from scratch. While I remember how to do it, here’s how it (once) worked for me: On Your...
read moreHow to use a PS4 Controller on your PS3
Even after so many years of use, I still love my Playstation 3. I can’t imagine a life without it. As such, I get nervous thinking about the fact that native PS3 Controllers are no longer in production. What happens when my ever so slightly worn out two controllers give up? How will I play my favourite platform games? Thankfully, Sony made it possible since software version 4.6 to use the newer Playstation 4 controllers on our Playstation 3 systems. Those are available in great numbers and colours, and from what I hear, they even have the...
read moreHow to add files to a ZIP archive on the Command Line
Before submitting ZIP files to various third parties, I often have the need to ether remove superfluous files from my archives. Until today I’ve never had the need to add a file to such archives. Had that happened in the past, I would have probably just deleted the whole archive and crated a new one from scratch. Today I felt adventurous and researched a way to add files to existing ZIP files and found a (not-so-obvious) solution to this puzzle, using the -r switch. Let me show you how it works: zip -rv YourArchive.zip NewFile.txt...
read moreShow Me The Cookies: How to list all cookies on your WordPress site
I’ve been working on a new plugin for WordPress called Cookies. It shows you a list of all cookies on your current site. Once activated, you can find this list under Appearance – Cookies. In addition, you can also display this list to your visitors by adding the shortcode [cookies] to any post or page. Many of those cookies are used by WordPress to track things such as “are you logged in”, so I’ve added an option to filter WordPress related cookies out. This list is available with the [cookies-nowp] shortcode....
read moreChild Theme Wizard – Version 1.3 released
This morning I felt like a bit of coding, and something that’s been on my to-do list for a while was to update my Child Theme Wizard plugin. It’s been making over 10.000 users happy since 2013. The main reason for the update was to update the compatibility flag with WordPress 5.1 – it was already compatible with the latest version, it just wasn’t explicitly set. On this occasion I found a couple of other items I could improve upon: updated the link to the WordPress Codex about Child Themesverified compatibility with...
read moreHow to copy Windows.old to an external drive
After a recent Windows 10 Refresh, I found myself with most of my data missing from my installation – a bit of a surprise, having done Windows refreshes before and seeing that I selected the option to “keep all my data”. Ah well… However, Windows was kind enough to preserve much of my previous configuration in an folder called Windows.old. As such, I could at least go back to some of the system data that I needed. Thank you, Windows Before moving on with major re-installation work, I thought it would be wise to...
read moreHow to disable the Login with WordPress.com prompt
One of my self hosted WordPress sites kept offering me to login with my WordPress.com credentials. I find that mindnumbingly annoying, since I don’t use WordPress.com (nor can I remember my credentials). Thankfully there’s an easy way to switch this prompt off. This integration comes courtesy of Jetpack. There’s an option under Jetpack – Settings – Security in which we can turn this feature on and off. After flicking the switch, this setting is saved automatically and WordPress won’t offer anything other...
read moreHow to use OBS Studio to record your screen
In this episode I’m going to show you how to use the excellent free OBS Studio for screen recordings. This is an open source, cross platform tool with amazing capabilities, yet it can be a little daunting to get started with it. While OBS Studio is commonly used for live streaming, it can do simple screen captures too. I’ll show you how to do that. I’ll begin by explaining the interface philosophy, then I’ll show you how to add a desktop to your scene, how to add a webcam as an overlay, how to add audio, and finally...
read more