Skip to content

Instantly share code, notes, and snippets.

View Garconis's full-sized avatar
🐞
Debugging

Jon Fuller Garconis

🐞
Debugging
View GitHub Profile
@Garconis
Garconis / change-woocommerce-giftcard-button-cta-url-in-email.php
Last active March 14, 2023 16:13 — forked from melek/gist:4bf187bfb85faf3864069777ea6d9cc3
WooCommerce | Change CTA URL for WooCommerce Gift Card Emails
<?php
add_filter('woocommerce_gc_email_received_action_button_url', 'custom_giftcard_cta_url', 10, 1);
function custom_giftcard_cta_url($url) {
return get_home_url();
}
@Garconis
Garconis / wp-all-import-hashed-passwords.php
Last active January 14, 2022 16:25 — forked from louisreingold/gist:1ef75e6b3623c5c66e4443dc762bfd52
WP All Import | Code to run in Function Editor during import, to add hashed password (from previous export) into password field
<?php
// https://www.youtube.com/watch?v=VEzAWMCwprQ
add_action( 'pmxi_saved_post', 'post_saved', 10, 1 );
function post_saved( $id ) {
global $wpdb;
$pass = get_user_meta( $id, 'xfer_user_pass', true );
$table = $wpdb->prefix . 'users';
$wpdb->query( $wpdb->prepare(
"
UPDATE `" . $table . "`
@Garconis
Garconis / tracking-code-at-checkout.php
Created August 19, 2020 20:00 — forked from WPprodigy/tracking-code-at-checkout.php
Add analytics tracking to the WooCommerce order received / thank-you page
/**
* Add Tracking Code to the Order Recieved Page
*/
function wc_ninja_checkout_analytics( $order_id ) {
$order = new WC_Order( $order_id );
$currency = $order->get_order_currency();
$total = $order->get_total();
$date = $order->order_date;
?>
<!-- Paste Tracking Code Under Here -->
@Garconis
Garconis / acf-states.txt
Created August 10, 2018 16:21 — forked from michaeldozark/acf-states.txt
State list for Advanced Custom Fields select field
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District of Columbia
FL : Florida
@Garconis
Garconis / woocommerce-shipment-tracking-providers.php
Last active October 24, 2017 20:18 — forked from DustinHartzler/shipment_tracking.php
WooCommerce | Remove options from the Shipment Tracking plugin
<?php
add_filter( 'wc_shipment_tracking_get_providers', 'custom_shipment_tracking' );
function custom_shipment_tracking( $providers ) {
// unset all the ones you don't want (e.g., we kept USPS and FedEx set)
unset($providers['Australia']);
unset($providers['Austria']);
unset($providers['Brazil']);
unset($providers['Belgium']);
@Garconis
Garconis / default-taxonomy-term-for-cpt.php
Last active September 14, 2017 12:32 — forked from mayeenulislam/Default Taxonomy Term for CPT
WordPress | Make Default taxonomy term(s) for Custom Post Type
<?php
/**
* Add an automatic default custom taxonomy for custom post type.
* If no taxonomy term is selected during post creation, the custom post will be assigned the specififed taxonomy terms during save.
* Just change the 'your-cpt-type' to your custom post type name
* and change 'fruit_tags' and 'soda_flavors' to the taxonomy slug(s) you want to target
* and change 'apple' and 'banana' and 'cola' with the slug(s) of the term(s) you want to make default
* you can add multiple taxonomy at once so the 'soda_flavors' line is applicable only then
*/