Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@matt-h
matt-h / array_moonwalk.php
Created June 8, 2017 15:47
array moonwalk updated
<?php
/**
* Moonwalk an array.
*
* Deduplicates multidimensional array by flattening it while preserving
* the deepest depth and flipping it inside out. Array values become the
* keys and the new values contain the depths.
*
* @since Hyperdrive 1.0.0
@matt-h
matt-h / array_moonwalk.php
Created June 8, 2017 15:37
array_moonwalk test
<?php
/**
* Moonwalk an array.
*
* Deduplicates multidimensional array by flattening it while preserving
* the deepest depth and flipping it inside out. Array values become the
* keys and the new values contain the depths.
*
* @since Hyperdrive 1.0.0
@matt-h
matt-h / findreplace.php
Created April 15, 2016 15:40
woocommerce email replacement string
<?php
function woocommerce_email_format_string_find( $find, $email ) {
$find['customer_info'] = '{customer_info}';
return $find;
}
add_filter( 'woocommerce_email_format_string_find', 'woocommerce_email_format_string_find', 10, 2 );
function woocommerce_email_format_string_replace( $replace, $email ) {
$replace['customer_info'] = 'replacement string';
return $replace;