add_filter( ‘wpml_hreflang_language_for_url’, function( $hreflang, $url, $lang ) { if ( $lang === ‘pt-br’ ) { return [‘pt-br’, ‘pt’]; // Add both pt-br and pt for Brazilian Portuguese } return $hreflang; }, 10, 3 );Continue reading
add_filter( ‘woocommerce_product_tabs’, ‘custom_product_meta_fields_tab’ ); function custom_product_meta_fields_tab( $tabs ) { $tabs[‘meta_fields_tab’] = array( ‘title’ => __( ‘Λεπτομέρειες Προϊόντος’, ‘woocommerce’ ), ‘priority’ => 15, ‘callback’ => ‘custom_product_meta_fields_content’ ); return $tabs; } function custom_product_meta_fields_content() { global $post; $systatika = get_post_meta( $post->ID, ‘systatika’, true…Continue reading
// Disable wp-embed.min.js function my_deregister_scripts(){ wp_dequeue_script( ‘wp-embed’ ); } add_action( ‘wp_footer’, ‘my_deregister_scripts’ );Continue reading
function year_shortcode() { $year = date_i18n (‘Y’); return $year; } // register shortcode add_shortcode(‘year’, ‘year_shortcode’);Continue reading
/** Remove all possible fields **/ function mrj_remove_checkout_fields( $fields ) { // Billing fields unset( $fields[‘billing’][‘billing_state’] ); unset( $fields[‘billing’][‘billing_company’] ); // Shipping fields unset( $fields[‘shipping’][‘shipping_state’] ); unset( $fields[‘shipping’][‘shipping_company’] ); return $fields; } add_filter( ‘woocommerce_checkout_fields’, ‘mrj_remove_checkout_fields’ );Continue reading
add_filter(‘woocommerce_available_payment_gateways’, ‘limit_payment_gateway_based_on_cart_total’); function limit_payment_gateway_based_on_cart_total($available_gateways) { if (is_admin() || !is_checkout()) { return $available_gateways; } // Get total cart $cart_total = WC()->cart->get_total(‘edit’); // Total cart without formattation // Set limit $limit = 1000; // Limit in local currency // If the total…Continue reading
add_filter( ‘wc_order_statuses’, ‘ts_rename_order_status_msg’, 20, 1 ); function ts_rename_order_status_msg( $order_statuses ) { $order_statuses[‘wc-on-hold’] = _x( ‘In attesa di pagamento’, ‘Order status’, ‘woocommerce’ ); return $order_statuses; }Continue reading