Skip to content

Instantly share code, notes, and snippets.

@rafiahmedd
rafiahmedd / Add more name prefix in Fluent CRM
Created August 16, 2021 05:29
Add more name prefix in Fluent CRM
add_filter('fluentcrm_contact_name_prefixes',function ($title){
$newTitles = ['Ahmed','Md'];
return array_merge($title,$newTitles);
},10,1);
@rafiahmedd
rafiahmedd / Email to Admin After User Unsubscribe From CRM With Unsubscribe Reason
Created August 4, 2021 22:53
Email to Admin After User Unsubscribe From CRM With Unsubscribe Reason
add_action('fluentcrm_subscriber_status_to_unsubscribed', 'emailAfterUnsubscribed', 10, 2);
function emailAfterUnsubscribed($subscriber, $oldStatus){
$req = FluentCrm('request');
$reason = sanitize_text_field($req->get('reason'));
if ($reason == 'other') {
if ($otherReason = $req->get('other_reason')) {
$reason = sanitize_text_field($otherReason);
}
} else if($reason){
if ( method_exists('ExternalPages', 'unsubscribeReasons' ) ) {
@tdrayson
tdrayson / FF-image-radio-field.css
Last active June 27, 2022 05:29
Fluent Forms Image Radio Field CSS
/**
* Styles the Radio field as clickable image for Fluent Forms
*
* Use: Paste into Custom CSS Section of your Form
* Add class "fancy-input" to container of all inputs that need the fancy styling
*
* Forked version of Sebastian Berger from inital post Fluent Forms FB Group - https://bit.ly/37BBpet
* FB Post - https://bit.ly/2ZEn2BG
*
* Full Links at bottom
@someguy9
someguy9 / disable-wordpress-admin-new-user-notification.php
Created May 14, 2020 19:05
Disable the WordPress new user email notification sent to the site admin
<?php
//Disable the new user notification sent to the site admin
function smartwp_disable_new_user_notifications() {
//Remove original use created emails
remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 );
//Add new function to take over email creation
add_action( 'register_new_user', 'smartwp_send_new_user_notifications' );
add_action( 'edit_user_created_user', 'smartwp_send_new_user_notifications', 10, 2 );
<?php
/*
Plugin Name: Limit Cart Weight to increments
Plugin URI: https://www.damiencarbery.com/
Description: Prevent checkout unless cart is above a minimum weight and increments of a weight.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@wy4tt34rp
wy4tt34rp / WooCommerce Filter Adding Captions to Gallery Thumbnails
Last active October 26, 2021 14:43
WooCommerce Filter Adding Captions to Gallery Thumbnails
@kittenlane
kittenlane / 1-remove-woocommerce-tabs.php
Last active November 30, 2023 20:07
Remove tabs but keep product description in WooCommerce
//* http://gasolicious.com/remove-tabs-keep-product-description-woocommerce/
// Location: add to functions.php
// Output: removes woocommerce tabs
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
@DevinWalker
DevinWalker / woocommerce-optimize-scripts.php
Last active January 8, 2024 13:24
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@kloon
kloon / functions.php
Last active March 4, 2024 19:36
WooCommerce total order weight column on orders page
<?php
add_filter( 'manage_edit-shop_order_columns', 'woo_order_weight_column' );
function woo_order_weight_column( $columns ) {
$columns['total_weight'] = __( 'Weight', 'woocommerce' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'woo_custom_order_weight_column', 2 );
function woo_custom_order_weight_column( $column ) {
global $post, $woocommerce, $the_order;
@Zodiac1978
Zodiac1978 / .htaccess
Last active March 15, 2024 08:29
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/