This file contains 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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: Search by Algolia for WooCommerce - Instant & Relevant results | |
*/ | |
/** | |
* If Algolia is not active, let users know. |
This file contains 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 | |
// Exclude coupons from being applied when products on sale | |
add_filter( 'woocommerce_coupon_is_valid', 'woocommerce_coupon_check_sale_items', 10, 2 ); | |
function woocommerce_coupon_check_sale_items( $valid, $coupon ) { | |
global $woocommerce; | |
$valid_for_cart = $valid; | |
if (sizeof($woocommerce->cart->get_cart())>0) : foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) : | |
if ( function_exists( 'get_product') ) | |
$product = get_product( $cart_item['product_id'] ); |
This file contains 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_filter( 'woocommerce_checkout_fields', 'filter_checkout_fields' ); | |
function filter_checkout_fields( $fields ) { | |
$fields['order']['order_comments']['maxlength'] = 200; | |
return $fields; | |
} |
This file contains 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 | |
/** | |
* Connect a Gravity Form File Upload Field to an ACF Image Field. | |
* @see https://joshuadnelson.com/connect-gravity-forms-file-upload-to-acf-gallery-field/ | |
*/ | |
$gravity_form_id = 1; // gravity form id, or replace {$gravity_form_id} below with this number | |
add_filter( "gform_after_submission_{$gravity_form_id}", 'jdn_set_acf_gallery_field', 10, 2 ); | |
function jdn_set_acf_gallery_field( $entry, $form ) { | |
$gf_images_field_id = 7; // the upload field id |
This file contains 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
function fsc_figure( $image, $size, $imageclass, $captionclass ){ | |
/** | |
* Let plugins pre-filter the image meta to be able to fix inconsistencies in the stored data. | |
* | |
* @param string $image The ACF field name (i.e. 'your_photo_name'). | |
* @param string $size Thumbnail size (i.e. 'Thumbnail', 'Medium', 'Large') | |
* @param string $imageclass The Figure class you want to use (ex: 'my-figure') | |
* @param string $captionclass The Figcaption class you want to use (ex: 'caption-blue') | |
*/ |
This file contains 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_action( 'woocommerce_email_after_order_table', 'add_payment_method_to_admin_new_order', 15, 2 ); | |
/** | |
* Add used coupons to the order confirmation email | |
* | |
*/ | |
function add_payment_method_to_admin_new_order( $order, $is_admin_email ) { | |
if ( $is_admin_email ) { | |
This file contains 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_action( 'wp_print_styles', 'dequeue_font_awesome_style' ); | |
function dequeue_font_awesome_style() { | |
wp_dequeue_style( 'font-awesome' ); | |
wp_deregister_style( 'font-awesome' ); | |
} | |
?> |
This file contains 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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-user-registration-skip-registration-for-existing-email.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // User Registration // Skip Registration if Email Exists | |
* | |
* If submitted email is already registered, skip registration. |
This file contains 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 | |
/** | |
* Simple logging for WordPress. | |
* | |
* @package BJ\Log | |
* @author bjornjohansen | |
* @version 0.1.0 | |
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License version 2 (GPLv2) | |
*/ |
OlderNewer