This file contains hidden or 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
| <script> | |
| // 1. Seleziona tutti gli elementi con la classe 'bg-change' | |
| const elements = document.querySelectorAll(".bg-change"); | |
| // 2. Itera su ogni elemento trovato | |
| elements.forEach(element => { | |
| // 3. GENERA UN NUOVO COLORE CASUALE AD OGNI ITERAZIONE del ciclo | |
| const randomColor = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, '0'); | |
This file contains hidden or 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( 'jet-engine/query-builder/query/items', function( $items, $query ) { | |
| if ( empty( $items ) || ! is_array( $items ) ) { | |
| return $items; | |
| } | |
| $taxonomy = 'authorizations'; | |
| $user = wp_get_current_user(); | |
| $user_role = $user->roles ? $user->roles[0] : 'guest'; |
This file contains hidden or 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
| sudo -v ; curl https://rclone.org/install.sh | sudo bash | |
| rclone config | |
| sudo -u pi HOME=/home/pi /usr/bin/rclone sync mega:download /srv/dev-disk-by-uuid-0A4865124864FDB7/Share/Mega --progress |
This file contains hidden or 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
| #!/bin/bash | |
| # Tempo di attesa in secondi dopo la sincronizzazione oraria (10 minuti) | |
| TEMPO_ATTESA=600 | |
| echo "Inizio script disattivazione Wi-Fi..." | |
| # 1. Attesa fissa per la sincronizzazione oraria (necessaria dato l'errore 404) | |
| echo "Attendo 30 secondi per assicurare la sincronizzazione oraria e l'avvio completo della rete." | |
| sleep 30 |
This file contains hidden or 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
| /** | |
| * Shortcode to get the product categories IDs present in the cart. | |
| * Hooked to 'wp_loaded' to ensure the cart is initialized. | |
| * Returns a string of (numeric) IDs separated by commas. | |
| */ | |
| function get_cart_categories_ids_shortcode() { | |
| // 1. Secure initialization and cart check | |
| if ( ! function_exists( 'WC' ) || is_null( WC()->cart ) ) { | |
| return ''; | |
| } |
This file contains hidden or 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
| /** | |
| * Unified Snippet Dokan + Vendor | |
| * Works with both generic User ID and product loop | |
| * WPCode: PHP Snippet → Run Everywhere | |
| */ | |
| if ( ! function_exists( 'sn_get_product_from_context' ) ) { | |
| function sn_get_product_from_context() { | |
| global $product; | |
| if ( isset( $product ) && is_object( $product ) ) return $product; |
This file contains hidden or 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 gl_brand_logo_shortcode( $atts ) { | |
| if ( is_admin() ) return ''; | |
| $atts = shortcode_atts([ | |
| 'size' => 'medium', // thumbnail|medium|large|full o 300x150 | |
| 'class' => 'brand-logo', | |
| 'link' => 'yes', // yes|no | |
| 'tax' => '' // lascia vuoto per auto-rilevare | |
| ], $atts, 'brand_logo'); |
This file contains hidden or 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_shortcode( 'sale_percentage', function( $atts ) { | |
| $atts = shortcode_atts( array( | |
| 'id' => get_the_ID(), | |
| ), $atts, 'sale_percentage' ); | |
| $product = wc_get_product( $atts['id'] ); | |
| if ( ! $product ) return ''; | |
| $max_percentage = 0; |