Advanced Search
Search Results
49 total results found
Minimal Cron
Change the following: Prefix: svd_ function svd_deactivate() { wp_clear_scheduled_hook( 'svd_cron' ); } add_action('init', function() { add_filter( 'cron_schedules', 'svd_schedule_cron' ); add_action( 'svd_cron', 'svd_run_cron' ); register_de...
SameSite Cookies
web.dev has a very insightful article on SameSite cookies. Read it to understand how they work. Value Intended Use Example SameSite=Lax Functionality affecting the display of the site. Includes first request. Theme switcher SameSite=St...
Run WP CLI On All Sites Within A Network
# update an option. wp site list --field=url | xargs -I % wp --url=% option update [option name] [option value]
Notes on Screen Recording
Recommended way Use Shift-Command-5 and capture a desktop. The microphone can be turned on under Options. Dismissed Quicktime Player no longer has the option to record sound during Screen Recordings, at least since macOS Mojave.
Sync the database schema
In rare situations, the WordPress database schema might not match the schema expected by the applications or plugin. For example switching to multisite, and the wp_users table is missing the spam and deleted colums To fix this issue locally, create a file in ...
Notetaking Tools
I'm always looking for a cross platform good value note taking solution. I work with the Linux and Apple ecosystems. Requirements I have the following requirements: Strong Privacy. Minimal effort required to input, grouping and search notes. Cross platf...
Bookmarking
To prevent rethreading the same research paths, I'm documenting my bookmark journey. I'm currently using Firefox across my devices and using it's inbuilt bookmark system. Acceptance criteria Bookmarks are searchable from the address bar, because that's wh...
DJ Setup
Hardware and Software WIP Categorising Music Separate DJ Music from your other music by moving it into a new location, ie DJ Music. Within that create a folder XXXX Added where XXXX is the year purchased, to separate music by time purchased. This is helpf...
Hooks for assets
Quick reference for where to hook in styles and scripts: Where Action Admin admin_enqueue_scripts Frontend wp_enqueue_scripts Block editor (admin) enqueue_block_editor_assets Blocks (front and admin) enqueue_block_assets ...
Troubleshooting local environment problems
A collection of troubleshooting tips to diagnose issues with a local environment that's not working right. WP CLI Issues Try wp cli info, if this fails then the issue is limited to WP CLI or PHP as this doesn't touch the codebase / DB.
Onboarding Questions
I’ve found information related to the following helps me onboard ne client services projects easier. Some of this might be already covered in a project overview, but might be a helpful as a checklist: Are there particular skills that are important for this ...
Nonces
WordPress nonces are not cryptographic nonces, as the latter are used only once, and the former are not: Nonces are regenerated every 12h, but are valid for 24h, hence that code. (12h = 1 tick, and they’re valid for two ticks)
Move a site to a new domain
Move a site workflow: Delete existing domain mappings for the site. wp search replace $old_url $new_url --all-tables; wp cache flush, avoiding trailing slashes. wp rewrite flush --url=$new_url; wp rewrite flush; Login to the network site, edit the site,...
Docksal Setup
Thoughts on running CodeIgniter with Docksal. Initial setup is easy # Setup CodeIgniter composer create-project codeigniter4/appstarter myproject cd myproject # Initialise a new Docksal project # set DOCROOT to public fin init # Plug the database ...
Change root site
To change the root site in a multisite network: define( 'BLOG_ID_CURRENT_SITE', 1 ); Plugins might not be compatbile with this change.
Resolving composer.lock merge conflicts
composer update --lock fixes lock file when merging branches with .lock conflicts.
Updating post data on status transition
You might be tempted to set the WP_Post properties (but this is an action), or use wp_update_post() but there is some hard-coded behaviour in wp_insert_post() that might affect your data. So it's better to emulate wp_publish_post(). function action_on_future...
Package type "library" is not supported
You might see the following message after running composer: Reading /Users/svandragt/.composer/auth.json Reading /Users/svandragt/dev/_hm/siemens/milestones.local/vendor/composer/installed.json Reading /Users/svandragt/.composer/vendor/composer/installed.js...
Blocks in Simple English
The following block types exist and this is what they do. I'm always getting confused by the terminology, as I'm not a native English speaker and the terminology does not cleanly map on other programming paradigms. Block Type What They Say What I say ...
Filter one-liners
Render links in content as HTML A elements: add_filter( 'the_content', 'make_clickable' );