Skip to content

Instantly share code, notes, and snippets.

@abadrahman
abadrahman / functions.php
Created December 5, 2017 16:10
Adding custom post meta to Woocommerce REST API V1
function ar_add_post_meta_to_order_api_response( $response ) {
$data = $response->get_data();
// Adding your custom field:
$data['postmeta'] = get_post_meta( $data['id'] );
$response->set_data( $data );
return $response;
@abadrahman
abadrahman / nginx.conf
Created July 17, 2017 13:29
wordpress installation in sub directory of wordpress rewrite conflicts.
#Add within server block to fix conflicts between permalinks when WP is installed within another WP installation
location /subdirectory/ {
try_files $uri $uri/ /subdirectory/index.php?$query_string;
}