Site / Home URLs
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
Update content Guid
<?php | |
add_filter( 'init', 'wc_tax_exempt_user_roles' ); | |
function wc_tax_exempt_user_roles() { | |
if ( ! is_admin() ) { | |
global $woocommerce; | |
if ( current_user_can('wholesaler') || current_user_can('distributor') ) { | |
$woocommerce->customer->set_is_vat_exempt(true); | |
} else { | |
$woocommerce->customer->set_is_vat_exempt(false); | |
} |
// Replace 7 with the ID of your form and 13 with the ID of the field you want to force "all required" | |
// http://www.gravityhelp.com/documentation/page/Gform_field_validation | |
add_filter("gform_field_validation_7_13", 'validate_tcs', 10, 4); | |
function validate_tcs($result, $value, $form, $field) { | |
// Convert the checkbox input name value (returned as part of "field") | |
// into the "underscored" ID version which is found in the $_POST | |
foreach ($field['inputs'] as $input) { | |
$input_post_value = 'input_' . str_replace('.', '_', $input['id']); | |
<?php | |
/** | |
* | |
* Decom Custom Functions | |
* Extend and Make Future Proof | |
* Just sample file - use filter for real cases | |
* @package Decom | |
* @registration field | |
* Email notifications | |
*/ |
/* | |
* Array | |
*/ | |
array( | |
'customer_processing_order', | |
'customer_completed_order', | |
'customer_order_confirmation', //germanmarket | |
'cancelled_order', | |
'customer_invoice', | |
'customer_note', |
function decom_paypal_disable_manager( $available_gateways ) { | |
global $woocommerce; | |
$user = wp_get_current_user(); | |
if ( isset( $available_gateways['cheque'] ) && (in_array( 'customer', $user->roles ) || in_array( 'client', $user->roles) || in_array( 'klingon', $user->roles) )) { | |
//unset( $available_gateways['cheque'] ); | |
} | |
else if ( isset( $available_gateways['paypal'] ) && ( in_array( 'wholesale', $user->roles ) || in_array( 'retailer', $user->roles) ) ) { | |
unset( $available_gateways['paypal'] ); | |
} |
<?php | |
/** | |
* Change text strings | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
* @link https://github.com/woothemes/woocommerce/blob/master/includes/widgets/class-wc-widget-layered-nav.php#L215 | |
* @link http://speakinginbytes.com/2013/10/gettext-filter-wordpress/ | |
*/ | |
function translate_string_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { |
/* | |
* stop(); Bourbon Time | |
* Bourbon-Neat smiple mixin for WordPress Gallery | |
* Extend to your needs - lets('bourbon').start(); | |
* damir created this for alex | |
*/ | |
$gallery-column-checker : (1, 2, 3, 4, 6, 8, 12, 24); | |
.gallery { | |
@include row(); |
<?php | |
$outofstock_arg = array( | |
'post_type' => array('product', 'product_variation'), //'product', 'product_variation' | |
'post_status' => 'publish', | |
'meta_query' => array( | |
// https://github.com/woothemes/woocommerce/blob/master/includes/admin/meta-boxes/class-wc-meta-box-product-data.php | |
array( | |
'key' => '_stock_status', | |
'value' => 'outofstock', //instock | |
'compare' => 'IN' |
<!-- custom post type and acf field + --> | |
<?php | |
$topdate = date('Y-m-d H:i:s'); | |
$main_match_arg = array( | |
'post_type' => 'matches', | |
'post_status' => 'publish', | |
'tax_query' => array( | |
'relation' => 'AND', | |
array( | |
'taxonomy' => 'decom_match_categories', |