For my first CPT, it seemed great that I could hook a function to post_updated_messages and customize the post messages. When I tried the same for 4 CPTs, only the last filter added was having any effect. Here’s my new DRY method. function set_custom_messages( $messages ) { global $post, $post_ID; $post_type = get_post_type( $post_ID ); $obj […]
Development
How to Change WordPress Multisite Domain Name
http://halfelf.org/2014/changing-domain-name-multisite/ which referenced this, as well https://github.com/interconnectit/Search-Replace-DB
How to force eject CD from the command line using OS X
Sometimes (most of them) my old MacBook just doesn’t want to let go of a CD or DVD. Command line to the rescue. From a Terminal window: $ drutil eject
Enqueue script on certain page
add_action( ‘admin_enqueue_scripts’, ‘admin_enqueue_scripts_example’ ); function admin_enqueue_scripts_example( $hook ) { if( ‘edit.php’ != $hook ) { return; } wp_enqueue_script( ‘my_custom_script’, plugin_dir_url( __FILE__ ) . ‘myscript.js’ ); }
DiffMerge, Git and OS X
git config –global diff.tool diffmerge git config –global difftool.diffmerge.cmd ‘diffmerge “$LOCAL” “$REMOTE”‘ git config –global merge.tool diffmerge git config –global mergetool.diffmerge.cmd ‘diffmerge –merge –result=”$MERGED” “$LOCAL” “$(if test -f “$BASE”; then echo “$BASE”; else echo “$LOCAL”; fi)” “$REMOTE”‘ git config –global mergetool.diffmerge.trustExitCode true Now git getdiff is available just as git diff # diff the local file.m against the checked-in version git difftool file.m # diff the local […]
Oh-My-Zsh Git Aliases
g git gst git status gd git diff gl git pull gup git pull –rebase gp git push gd git diff gc git commit -v gc! git commit -v –amend gca git commit -v -a gca! git commit -v -a –amend gco git checkout gcm git checkout master gr git remote grv git remote -v […]