A list of my most used commands as well as a few from Oh My Zsh!
https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet
getmaster "feature/foo-branch"
| /** | |
| * Block external WordPress API request | |
| */ | |
| function wp_api_block_request($pre, $args, $url) | |
| { | |
| if (strpos($url, 'api.wordpress.org')) { | |
| return true; | |
| } else { | |
| return $pre; | |
| } |
A list of my most used commands as well as a few from Oh My Zsh!
https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet
getmaster "feature/foo-branch"
| ########################################## | |
| # WP-cli | |
| ########################################## | |
| ALIASES | |
| ########################################## | |
| alias wpcdl=wp_core_download |
| #!/bin/bash | |
| # | |
| # USE FOR LOCAL DEVELOPMENT ONLY!!! | |
| # | |
| EMAIL='[email protected]' | |
| MYSQL=`which mysql` | |
| echo -n "DB user/name for project (lowercase) [ENTER]:" | |
| read DB |
| # wp-cli | |
| complete -c wp -l cache --description 'Manage the object cache.' | |
| complete -c wp -l cap --description 'Manage user capabilities.' | |
| complete -c wp -l cli --description 'Get information about WP-CLI itself.' | |
| complete -c wp -l comment --description 'Manage comments.' | |
| complete -c wp -l core --description 'Download, install, update and otherwise manage WordPress proper.' | |
| complete -c wp -l cron --description 'Manage WP-Cron events and schedules.' | |
| complete -c wp -l db --description 'Perform basic database operations.' | |
| complete -c wp -l eval --description 'Execute arbitrary PHP code.' | |
| complete -c wp -l eval-file --description 'Load and execute a PHP file.' |
| @echo off | |
| :: Source: https://indigotree.co.uk/automated-wordpress-installation-cmd/ | |
| :: STEPS: | |
| :: 1. Install wp-cli | |
| :: 2. Install composer | |
| :: 3. Install MySQL | |
| :: 4. Configure wp-cli at System PATH | |
| :: 5. Configure composer at System PATH |
| add_filter( 'woocommerce_order_number', 'jm_woocommerce_order_number', 1, 2 ); | |
| /** | |
| * Remove # prefix from WooCommerce Order Number | |
| * Could also be done with gettext: https://github.com/woothemes/woocommerce/blob/master/includes/abstracts/abstract-wc-order.php#L537 | |
| * | |
| */ | |
| function jm_woocommerce_order_number( $oldnumber, $order ) { | |
| return str_replace('#', '', $order->id); | |
| } |