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
| <?php | |
| /** | |
| * The Events Calendar Remove Events from Month and List Views | |
| * | |
| * @param [object] $query Query of the events page. | |
| * @return [object] Modified Query | |
| */ | |
| function tribe_exclude_events_category_month_list( $query ) { | |
| if ( isset( $query->query_vars['eventDisplay'] ) && ! is_singular( 'tribe_events' ) ) { |
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
| <?php | |
| add_filter( | |
| 'all_plugins', | |
| function ( $plugins ) { | |
| $shouldHide = ! array_key_exists( 'show_all', $_GET ); | |
| if ( $shouldHide ) { |
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
| <?php | |
| /** | |
| * Add custom merge tag to the merge tags drop down in the form editor | |
| * | |
| * @param array $merge_tags | |
| * @param int $form_id | |
| * @param array $fields | |
| * @param int $element_id | |
| * | |
| * @return array |
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
| -- Queste query SQL aggiornano tutti i prezzi, comprese le variazioni, in WooCommerce. | |
| -- In questo caso, tutti i prezzi vengono scontati del 20% (moltiplicati per 0.8). | |
| -- Aggiorna il prezzo regolare se il valore esiste e la chiave meta è '_regular_price'. | |
| UPDATE wpjd_postmeta SET meta_value = meta_value * 0.8 WHERE meta_key = '_regular_price' AND meta_value != ''; | |
| -- Aggiorna il prezzo in offerta se il valore esiste e la chiave meta è '_sale_price'. | |
| UPDATE wpjd_postmeta SET meta_value = meta_value * 0.8 WHERE meta_key = '_sale_price' AND meta_value != ''; | |
| -- Aggiorna il prezzo se il valore esiste e la chiave meta è '_price'. |
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
| <?php | |
| // Aggiungi un filtro per modificare l'HTML del menu a tendina per le opzioni di variazione degli attributi | |
| add_filter('woocommerce_dropdown_variation_attribute_options_html', 'wc_dropdown_variation_attribute_options_sorted', 20, 2); | |
| // Funzione per ordinare le opzioni di variazione degli attributi | |
| function wc_dropdown_variation_attribute_options_sorted( $html, $args ) { | |
| // Analizza gli argomenti con i valori predefiniti | |
| $args = wp_parse_args( | |
| apply_filters( 'woocommerce_dropdown_variation_attribute_options_args', $args ), |
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
| <?php | |
| /* | |
| * Esporta i clienti che hanno effettuato gli ordini in un file CSV | |
| */ | |
| function export_customers_to_csv() { | |
| ob_end_clean(); | |
| ob_start(); | |
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
| <?php | |
| add_action( 'vc_after_mapping', 'add_background_image_option_to_row' ); | |
| function add_background_image_option_to_row() { | |
| // Aggiungi l'opzione di design | |
| vc_add_param( 'vc_row', array( | |
| 'type' => 'checkbox', | |
| 'heading' => __( 'Usa immagine in evidenza della categoria come sfondo?', 'text-domain' ), | |
| 'param_name' => 'use_category_image_as_background', |
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
| UPDATE wp154_posts | |
| SET post_excerpt = REPLACE(post_excerpt, | |
| SUBSTRING(post_excerpt, | |
| LOCATE('[iw_product_price id=', post_excerpt), | |
| LOCATE(']', post_excerpt, LOCATE('[iw_product_price id=', post_excerpt)) - LOCATE('[iw_product_price id=', post_excerpt) + 1 | |
| ), | |
| '' | |
| ) | |
| WHERE post_type = 'product' AND post_excerpt LIKE '%[iw_product_price id=%'; |
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
| .product-wrapper img { | |
| width: 100%; | |
| height: 300px !important; | |
| object-fit: contain; | |
| } |
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
| Installazione | |
| 1) wget https://getcomposer.org/installer | |
| 2) php installer | |
| 3) php composer.phar | |
| // "cd" directory preferita |