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 snippet should go at the bottom of your functions.php file. | |
* Send a notification email to the user after a form is successfully submitted | |
* @sample snippet | |
*/ | |
function yikes_easy_forms_for_mailchimp_email_notifications( $email, $submitted_data, $form, $notifications ) { | |
if( ! empty( $submitted_data ) ) { | |
// add additional items you don't want included in the email notification | |
$exclude_from_email = array( |
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 | |
/* | |
* Remove unused shipping rates from the dashboard | |
* note: WC_Shipping_Flat_Rate does not work here | |
* Defaults: | |
* - WC_Shipping_Free_Shipping | |
* - WC_Shipping_International_Delivery | |
* - WC_Shipping_Local_Delivery | |
* - WC_Shipping_Local_Pickup | |
*/ |
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 | |
/* | |
* Add a hidden field to our WooCommerce login form - passing in the refering page URL | |
* Note: the input (hidden) field doesn't actually get created unless the user was directed | |
* to this page from a single product page | |
*/ | |
function redirect_user_back_to_product() { | |
// check for a referer | |
$referer = wp_get_referer(); | |
// if there was a referer.. |
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
jQuery( 'html, body' ).animate({ | |
scrollTop: jQuery( "#elementtoScrollToID" ).offset().top | |
}, 2000); |
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 | |
/** | |
* Disable free shipping for select WooCommerce product categories | |
* - In this case, free shipping is disabled when a product has the category with ID 112 assigned to it | |
* @param bool $is_available | |
*/ | |
function disable_free_shipping_for_certain_product_categories( $is_available ) { | |
global $woocommerce; | |
// set the product ids that are ineligible |
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 | |
/* | |
* Add a new custom tag to the 'pre defined tags' section | |
* @ Change 'tag', 'description' and 'title' to suit your needs. | |
* @ $available_tags - the default pre-defined tags available out of the box | |
*/ | |
add_filter( 'yikes-mailchimp-custom-default-value-tags', 'add_new_pre_defined_tags' ); | |
function add_new_pre_defined_tags( $available_tags ) { | |
// define a new array, with our default tag data (note: to create more than one, simply copy and paste what is below and alter the values) |
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 snippet gets placed at the bottom of your active themes functions.php file | |
* - This is necessary as some themes load their own set of icons and use !important; which conflicts with our plugin | |
*/ | |
/* | |
* Fix theme's overriding the default icon set in the dashboard | |
*/ |
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 | |
/* | |
* Grab the contents of an ACF 'file' field, called attached_file, on the page the form was submitted on (ie: page with ID 15) | |
* and re-direct the user to that URL (to download the file) after a successful submission. | |
* @since 0.1 | |
*/ | |
function yikes_mailchimp_alter_redirect_url( $url, $form_id, $page_data ) { | |
// grab the ACF field -- returns an array | |
// (Example: Array ( [id] => 43 [alt] => [title] => 2002 [caption] => [description] => [mime_type] => file/zip [url] => http://www.example.com/file.zip ) ) |
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 | |
/* | |
* Add a new custom tag to the 'pre defined tags' section | |
* @ Change 'tag', 'description' and 'title' to suit your needs. | |
* @ $available_tags - the default pre-defined tags available out of the box | |
*/ | |
add_filter( 'yikes-mailchimp-custom-default-value-tags', 'add_new_pre_defined_tags' ); | |
function add_new_pre_defined_tags( $available_tags ) { | |
// define a new array, with our default tag data (note: to create more than one, simply copy and paste what is below and alter the values) | |
$available_tags[] = array( |
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 | |
/* | |
* Alter the URL the user is redirected to after a successfull submission of form #3 | |
* - Add a custom URL, or add query args to the page URL selected on the edit forms page | |
* @parameters | |
* $url - the original URL set on the edit forms page | |
* $form_id - the ID of the form that was submitted | |
* $page_data - the global $post data - contains all sorts of info about the current page (including ID, title etc.) | |
*/ | |
function yikes_mailchimp_alter_redirect_url( $url, $form_id, $page_data ) { |