Skip to content

Instantly share code, notes, and snippets.

@adczk
adczk / woo-shipping-remove-local-if-free.php
Created February 5, 2022 18:03
WooCommerce - remove local pickup if free shipping available
<?php
/**
* Hide shipping rates when free shipping is available.
* Updated to support WooCommerce 2.6 Shipping Zones.
*
* @param array $rates Array of rates found for the package.
* @return array
*
* removes only LOCAL PICKUP if FREE SHIPPING is available
@adczk
adczk / forminator-regmail-customize.php
Created February 7, 2022 14:21
Forminator - customize new user registration mail
<?php
/*****************************
*
* A very crude way to customize new user registration mail for Frominator
* use as MU plugin
*
* customize message in $new_message variable
* customize subject in $mail_args[ 'subject' ] = 'New subject"; line
*
* tested with Forminator 1.15.10
@adczk
adczk / forminator-woo-title-prefill.php
Last active February 11, 2022 15:15
Forminator - prefill text field with post title (works with Woo Commerce products too)
<?php
/**************************************
*
* Forminator - prefill text field with post title
*
*
* by Adam/WPMU
*
*
@adczk
adczk / forminator-compare-email-fields.php
Created April 18, 2022 11:55
Forminator - compare two e-mail fields if they are the same
<?php
/************************************
*
* Forminator - compare two e-mail fields to confirm; if different, issue error
*
* by adamcz/WPMU DEV
* Tested with Forminator 1.15.12
*
* Use as MU plugin
@adczk
adczk / forminator-prevent-field-copypaste.php
Created April 18, 2022 12:11
Forminator - prevent field cut, copy, paste
<?php
/*************************
*
* Forminator - prevent cut/copy/paste in fields
*
* adjust fields CSS IDs in code if needed
*
* by adamcz/WPMU DEV
*
@adczk
adczk / wpmudev-host-hb-avada-cache-fix.php
Last active May 11, 2022 10:25
WPMU HOSTING Avada + Hummingbird Avada cache clear
<?php
/*
* MU PLUGIN
* for WPMU DEV Hosted sites with Avada (and Fusion Cache in general)
*
* fixes issue: posts that are added to site do not show up on homepage until all caches are cleared
*
* add this as MU plugin and make sure that Page Cache is active in HB and set to
* clear full cache when post/page is updated
@adczk
adczk / forminator-disallow-e0mails.php
Created May 30, 2022 09:05
Forminator - disallow use of specific e-mails, block submission
<?php
/************************************
*
* Forminator - disallow some e-mails, issue error
*
* by adamcz/WPMU DEV
* Tested with Forminator 1.15.14
*
* Use as MU plugin
@adczk
adczk / forminator-hide-form-until.php
Created June 24, 2022 11:24
Forminator - hide form before certain date
<?php
/*
* MU PLUGIN
*
* hides forminator form until set date
*
* use as MU plugin
* tested with Forminator 1.17.0
*
@adczk
adczk / forminator-send-to-external-url-like-html-form.php
Last active September 2, 2025 08:24
Forminator - simulate any 3rd party standard HTML form and send data as POST request to any URL, just like typical HTML form
<?php
/*
Forminator - send to eternal url like HTML form
This basically "emulates" any standard 3rd-party HTML form with Forminator
Example use - whenever you need to put standard HTML form on WP site but want to use/integrate Formiantor instead,
created for Capsule CRM initially (their "webform integration") but can be used practically with enything else
Tested with Forminator 1.17.1 - 1.24.6
@adczk
adczk / forminator-radio-auto-next.php
Last active July 27, 2022 15:12
Forminator - automatically move to next page on radio button selection on paged forms
<?php
/*
Use as MU plugin
Put this string in "Additional CSS Classes" field
in "Styling" tab of settings
of the "radio" field that should cause "auto next page":