Display a file from another git branch

If you have one branch checked out but want to see what a file looks like on another branch or a previous revision, use git cat-file:

$ git cat-file -p <branch>:</path/to/file>

It’s a slicker technique than checking out the branch and viewing the file directly. Especially if you have local edits that you’d otherwise have to stash or discard before changing branches.

(git cat-file is actually a very versatile for examining objects in the Git database. Along with the gitrevisions manpage, you can inspect just about anything in the Git database.)

Disabling WP-Cron

Set the DISABLE_WP_CRON constant in wp-config.php to prevent WordPress from spawning its pseudo-cron implementation:

define ( 'DISABLE_WP_CRON', true );

If you set this, need to make sure /wp-cron.php is hit periodically, otherwise scheduled tasks won’t execute.

Adding metadata to fields created by Advanced Custom Fields

Use add_post_meta and update_post_meta and the field name provided when creating the custom field. ACF is smart enough to figure it out.