This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add VAT and SSN fields in billing address display | |
add_filter( 'woocommerce_order_formatted_billing_address', 'custom_add_vat_ssn_formatted_billing_address', 10, 2 ); | |
function custom_add_vat_ssn_formatted_billing_address( $fields, $order ) { | |
$fields['vat'] = $order->billing_vat; | |
$fields['ssn'] = $order->billing_ssn; | |
return $fields; | |
} | |
add_filter( 'woocommerce_my_account_my_address_formatted_address', 'custom_my_account_my_address_formatted_address', 10, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fwp_index_categories( $params, $class ) { | |
if ( 'product_cat' == $params['facet_name'] && 0 < (int) $params['depth'] ) { | |
return false; // skip this term | |
} | |
elseif ( 'product_sub_cat' == $params['facet_name'] && 0 == (int) $params['depth'] ) { | |
return false; // skip this term | |
} | |
return $params; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Make sure the function does not exist before defining it | |
*/ | |
if( ! function_exists( 'remove_class_filter' ) ){ | |
/** | |
* Remove Class Filter Without Access to Class Object | |
* | |
* In order to use the core WordPress remove_filter() on a filter added with the callback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function uploads a file from a URL to the media library, designed to be placed in your own theme or plugin. | |
* Metadata will be generated and images will generate thumbnails automatically. | |
* | |
* HOW TO USE: | |
* 1. Add the function below to your theme or plugin | |
* 2. Call the function and provide the URL to an image or other file. | |
* 3. If successful, the attachment ID will be returned. |