- Updated 20 August 2016
- SSH into the Pressmatic box
$ apt-get update
$ apt-get install curl php5-cli git subversion
$ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
<?php | |
/** | |
* Dynamically populate the values for Gravity Form drop downs | |
* | |
* @param array $form | |
* @return mixed | |
* @access public | |
*/ | |
function az_gravityforms_dynamic_dropdown_values( $form ) { |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
# Attempt to load files from production if | |
# they're not in our local version | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule wp-content/uploads/(.*) \ | |
http://{PROD}/wp-content/uploads/$1 [NC,L] | |
</IfModule> |
<?php | |
// Create the query var so that WP catches your custom /staff/username url | |
add_filter( 'query_vars', 'bb_rewrite_add_var' ); | |
function bb_rewrite_add_var( $vars ) | |
{ | |
$vars[] = 'staff'; | |
return $vars; | |
} |
<?php | |
// Open file pointer to standard output | |
$fp = fopen( 'php://output', 'w' ); | |
// Write BOM character sequence to fix UTF-8 in Excel | |
fputs( $fp, $bom = chr(0xEF) . chr(0xBB) . chr(0xBF) ); | |
// Write the rest of CSV to the file | |
if ( $fp ) { |
<?php | |
add_filter('acf/load_field/name=name', 'az_acf_meta_box_display'); | |
add_filter('acf/load_field/name=age', 'az_acf_meta_box_display'); | |
add_filter('acf/load_field/name=favorite_colour', 'az_acf_meta_box_display'); | |
/** | |
* Control the display of ACF groups programmatically in WordPress | |
* | |
* @param array $field |
sudo rsync -avz -e "ssh -p 1234" ssh-user@domain:path-to-uploads/* . |
<?php | |
// Register a new route | |
add_action( 'rest_api_init', function () { | |
register_rest_route( 'portal/v1', '/messages/favourite/toggle', array( | |
'methods' => 'POST', | |
'callback' => 'change_favorite_status_of_a_message', | |
) ); | |
} ); |