Archives: Snippets
campaign debug
return true
return true;Continue reading
wp-config
define( ‘OPTINMONSTER_API_USER’, ‘your_username_here’ ); define( ‘OPTINMONSTER_API_KEY’, ‘your_key_here’ );Continue reading
Shortcode widget main categories WooCommerce
function shortcode_categorie_principali_wc() { $args = array( ‘taxonomy’ => ‘product_cat’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘hide_empty’ => false, ‘parent’ => 0, ‘pad_counts’ => true, ‘hierarchical’ => true, ); $categories = get_terms($args); if (empty($categories) || is_wp_error($categories)) { return ‘ Nessuna categoria…Continue reading
Remove Express Checkout Button for Wholesale Users
#== Remove Express Checkout Button for Wholesale Users ==# function remove_express_checkout_button() { global $wp_filter, $wc_wholesale_prices; $user_wholesale_role = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole(); if( empty( $user_wholesale_role ) ) { return; } $hooks_to_clean = [ ‘woocommerce_after_add_to_cart_form’ => 1, ‘woocommerce_proceed_to_checkout’ => 21, ‘woocommerce_checkout_before_customer_details’ => 1, ‘woocommerce_pay_order_before_payment’ =>…Continue reading
Remove Decimal Points In Suggested (US)
document.addEventListener(‘DOMContentLoaded’, function () { // Select all span elements inside the ul with the class ‘donation-amounts’ const amountSpans = document.querySelectorAll(‘.donation-amounts span.amount’); amountSpans.forEach(span => { // Get the current text content let value = span.textContent; // Find the index of the…Continue reading
Header
Add Custom Attributes and Group Them
// Step 1: Add your custom attribute(s) to a named group function add_custom_grouped_attributes( $attributes ) { // Define your own group label here $group_label = ‘Other fields’; // e.g., ‘Image attributes’, ‘Custom data’, etc. // Initialize group if not set…Continue reading