Elementor LCP Image Preloader (copy)

/** * Elementor LCP Background Image Preloader v2.1 * * Extracts the EXACT URL from Elementor’s _elementor_data JSON * This ensures the preloaded URL matches what Elementor’s CSS requests * * WPCODE SETUP: * – Code Type: PHP Snippet *…Continue reading

Elementor LCP Image Preloader (copy)

/** * Elementor LCP Background Image Preloader v2.1 * * Extracts the EXACT URL from Elementor’s _elementor_data JSON * This ensures the preloaded URL matches what Elementor’s CSS requests * * WPCODE SETUP: * – Code Type: PHP Snippet *…Continue reading

FC – Ayuda con debug

add_action(‘doing_it_wrong_run’, function($function, $message, $version) { if ($function !== ‘_load_textdomain_just_in_time’) return; if (strpos($message, ‘dominio acf‘) === false && strpos($message, ‘domain acf‘) === false) return; $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); // Recorta un poco para que sea legible $lines = []; foreach (array_slice($bt, 0,…Continue reading

Rimozione tab review/recensioni da PDP

// 1) Rimuove completamente l’area tabs add_action(‘wp’, function () { remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 10 ); }); // 2) Stampa la descrizione lunga al posto dei tabs add_action( ‘woocommerce_after_single_product_summary’, function () { global $post; if ( ! empty( $post->post_content ) )…Continue reading

Disable Specific Products From Coupons

// Create and display the custom field in product general setting tab add_action( ‘woocommerce_product_options_general_product_data’, ‘add_custom_field_general_product_fields’ ); function add_custom_field_general_product_fields(){ global $post; echo ‘ ‘; // Custom Product Checkbox Field woocommerce_wp_checkbox( array( ‘id’ => ‘_disabled_for_coupons’, ‘label’ => __(‘Disabled for coupons’, ‘woocommerce’), ‘description’…Continue reading

Defer WooCommerce Transactional Emails

/** * This will turn on deferred transactional emails in WooCommerce. This may help if you * are experiencing slow checkouts or checkout timeouts. */ add_filter( ‘woocommerce_defer_transactional_emails’, ‘__return_true’ );Continue reading

Add shipping short description

function ts_add_description_field_to_shipping_method( $fields ) { $fields[‘short_description’] = array( ‘title’ => __( ‘Short Description’, ‘woocommerce’ ), ‘type’ => ‘textarea’, ‘description’ => __( ‘Add a short description for this shipping method.’, ‘woocommerce’ ), ‘default’ => ”, ‘desc_tip’ => true, ); return $fields;…Continue reading