Skip to content

Instantly share code, notes, and snippets.

remove_filter( 'woocommerce_default_address_fields', 'get_default_address_fields', 10, 1 );
add_filter( 'woocommerce_default_address_fields', 'updated_get_default_address_fields', 10, 1 );
function updated_get_default_address_fields() {
global $woocommerce;
$fields = array(
'first_name' => array(
'label' => __( 'First Name', 'woocommerce' ),
'required' => true,
'class' => array( 'form-row-first' ),
),
@logoscreative
logoscreative / plugin.php
Last active February 1, 2023 12:14
Friendlier, Safer WordPress Admin Areas
<?php
/**
* "Friendlier, Safer WordPress Admin Areas"
* Presented by Cliff Seal at WordCamp Atlanta 2015 and Asheville 2016
* Slides: http://www.slideshare.net/cliffseal/wp-admin
*
* Plugin Name: A Better Admin Experience
* Plugin URI: http://evermoresites.com
* Description: Cleans up and sanitizes the WordPress admin area
* Version: 1.0
@maxrice
maxrice / wc-rename-checkout-coupon-field.php
Last active October 8, 2025 00:29
WooCommerce - rename the "Have a Coupon?" message and "Apply Coupon" field on the checkout
<?php
// rename the "Have a Coupon?" message on the checkout page
function woocommerce_rename_coupon_message_on_checkout() {
return 'Have a Promo Code?' . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>';
}
add_filter( 'woocommerce_checkout_coupon_message', 'woocommerce_rename_coupon_message_on_checkout' );
// rename the coupon field on the checkout page
@ChromeOrange
ChromeOrange / gist:5778923
Created June 14, 2013 01:59
Remove postcode requirement if billing or shipping country is Ireland
/**
* Remove postcode requirement if billing or shipping country is Ireland
* Add to your theme functions.php file
*/
add_action( 'woocommerce_checkout_process', 'custom_country_check' );
function custom_country_check(){
global $woocommerce;