This file contains hidden or 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 PHP script takes a list of IPv4 addresses and performs the following operations: | |
- Remove Duplicates: Eliminates any duplicate IP addresses from the list. | |
- IPv4 Validation: Checks if each entry is a valid IPv4 address. Invalid entries are retained but not duplicated. | |
- Wildcard Replacement: For IPs with the same prefix (first three octets), replaces them with a single entry using a wildcard for the last octet. | |
- Preserve Unique IPs: If an IP address has a unique prefix, it's retained in its original form. | |
Usage | |
- Replace the $ipList variable with your list of IP addresses, one per line. |
This file contains hidden or 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 into your theme's functions file | |
function tha_update_woo_shipping_province_change(){ | |
if ( function_exists('is_checkout') && is_checkout() ) { | |
?> | |
<script> | |
window.addEventListener('load', function(){ | |
var el = document.getElementById("billing_state_field"); | |
el.className += ' update_totals_on_change'; | |
}); |
This file contains hidden or 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
/* | |
Cookie Marketo form data and pre-fill other Marketo forms | |
- works across site for any Marketo forms (if they use the same field names) | |
- saves and updates only changed form values | |
- saves values either on form submit or after the field value is entered | |
- can hide pre-filled form data - useful for progressive profiling | |
Needs: https://github.com/carhartl/jquery-cookie |