These are a few small utility functions that I use when working on WordPress.
These can be copied directly into your ~/.bashrc
or ~/.zshrc
file (whichever is applicable) or put them in a file that is added to your path. I use Oh My Zsh on my sytem, and have this file saved to ~/.oh-my-zsh/custom/plugins/wp-dev/wp-dev.plugin.zsh
and have added wp-dev
to the list of plugins in my .zshrc
file.
Quickly apply a PR from https://github.com/WordPress/wordpress-develop as a patch to an SVN checkout of WordPress. This is a huge time saver when I'm committing changes to WordPress.
Example – Apply the PR from WordPress/wordpress-develop#7253:
gh-patch 7253
Toggle the LOCAL_PHP_XDEBUG
value used by the wordpress-develop docker environment to enable/disable XDebug.
Note: the environment has to be restarted for the changes to take effect.
Examples:
Passing no arguments turns XDebug on
xdb
Passsing either on
or off
to turn XDebug on/off
# Turn XDebug on
xdb on
# Turn XDebug off
xdb on
Toggle the LOCAL_PHP_MEMCACHED
value used by the wordpress-develop docker environment to enable/disable Memcached to test persistant object caches.
Note: the environment has to be restarted for the changes to take effect.
Examples:
Passing no arguments turns Memcached on
memcached
Passsing either on
or off
to turn Memcached on/off
# Turn Memcached on
memcached on
# Turn Memcached off
memcached on