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 );
@EmadAdly
EmadAdly / SSL-renewal.md
Last active June 11, 2024 10:48
Renew The Let’s Encrypt Certificate in bitnami

Renew The Let’s Encrypt Certificate

Let’s Encrypt certificates are only valid for 90 days. To renew the certificate before it expires, run the following commands from the server console as the bitnami user. Remember to replace the DOMAIN placeholder with your actual domain name, and the EMAIL-ADDRESS placeholder with your email address.

1- Login your server using SSH

ssh -i Key.pem bitnami@00.00.00.00

2- Stop Apache Server

sudo /opt/bitnami/ctlscript.sh stop

<?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 June 21, 2024 22:52
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;