WordPress has a function to validate file names
And itβs quite simple sanitize_file_name( ‘R@ndom Fi(l)e?!.txt’ ) will become [email protected] Official documentation sanitize_file_name
Another tech Blog
And itβs quite simple sanitize_file_name( ‘R@ndom Fi(l)e?!.txt’ ) will become [email protected] Official documentation sanitize_file_name
The following command will create a full backup in a tar file.The main reason I’m adding it here is because I want a exhaustive and growing list of excludes. Run this above the public_html. This way the backup won’t be publicly available. Importing the Dump. The unzip command: Now change the DB settings in the … Continue reading “Create full site Zip Backup”
In this guide we will install php 7.4 and do very basic tweaks. This should also work with php8 and older versions.
GitHub actions allow you to automate processes when code get send to GitHub. For example: when a pull request is approved or when a single commit is pushed. There are a lot of events and the rabbit hole goes deep. If you can think of something to automate, it’s probably possible.In the past I’ve worked … Continue reading “Github actions”
Hi π, I’m Jan-Willem, a 30-something WordPress back-end developer from the Netherlands.I like WordPress, Raspberri Pi’s(this blog runs on a pi) and Nintendo. I am the co-organizer of the WP meetup Zwolle, Volunteer at most Dutch WordCamps.And contributer to the wp-cli project. This is my incredibly irregular blog.π’ Plugins I developed on wordpress.org Freelancer As … Continue reading “About”
The case I was dealing with. There is a posttype “person” and it had the normal templates, a archive-person.php and single-person.php with a bunch of metadata. Which where visible on example.com/person/john-doe and the archive example.com/persons.So far nothing special. Every “person” was a -well- person. Some persons where also a “Judge”. A judge was an extra … Continue reading “Shadow Posttype”
By default Gravity forms isn’t accessible by editors. There are ways to do this with plugins like members.As some might guess I prefer wp-cli for this: Running this will pretty much give all rights except the settings of Gravifty Forms.It will allow creatign, editing & deleting forms. But also view entries and export them. Full … Continue reading “Gravity Forms give editors access”
This is one of those “I know this is possible, but don’t know how”. Only useful for simple onelines. You’re very likely to be better of putting code in a php file and run that script like: Run PHP with WordPress loaded. Of course your good old friend wp-cli can help.It can run code with … Continue reading “Running php from command line”
Install extra programs on the Raspberry Pi
Often you need the filename. And if you only need the file name that’s annoying to parse. –porcelain flag to the rescue! This will work on a lot of commands that have one item output.Stuff like wp post create ….Here is a complete list of commands that have the –porcelain flag Commands that output more … Continue reading “wp cli output format with –porcelain”