Skip to content

Instantly share code, notes, and snippets.

@lenamtl
lenamtl / font_awesome_5.php
Created July 23, 2021 23:28 — forked from yerooleopard/font_awesome_5.php
WPBakery Page Builder for WordPress (formerly Visual Composer) - Font Awesome 5 iconpicker integration
<?php
add_filter( 'vc_iconpicker-type-fontawesomenew', 'omnis_vc_iconpicker_type_fontawesome_5' );
function omnis_vc_iconpicker_type_fontawesome_5( $icons ) {
$font_awesome_5 = array(
'Brands' => array(
array('fab fa-500px' => '500px'),
array('fab fa-accessible-icon' => 'accessible-icon'),
array('fab fa-accusoft' => 'accusoft'),
array('fab fa-adn' => 'adn'),
@lenamtl
lenamtl / gist:777d59119a57949bdb53b32dc53a90f1
Created April 27, 2021 13:13 — forked from mikejolley/gist:84779259d3629edb7543
Load a custom translation file from the WP_LANG directory
// Code to be placed in functions.php of your theme or a custom plugin file.
add_filter( 'load_textdomain_mofile', 'load_custom_plugin_translation_file', 10, 2 );
/*
* Replace 'textdomain' with your plugin's textdomain. e.g. 'woocommerce'.
* File to be named, for example, yourtranslationfile-en_GB.mo
* File to be placed, for example, wp-content/lanaguages/textdomain/yourtranslationfile-en_GB.mo
*/
function load_custom_plugin_translation_file( $mofile, $domain ) {
if ( 'textdomain' === $domain ) {
@lenamtl
lenamtl / README.md
Created April 2, 2021 15:52 — forked from signalpoint/README.md
Bootstrap 4 Dynamic Modal with JavaScript

Use this to dynamically create and set the content of a Bootstrap 4 Modal.

In this example, we chose an onclick handler to initialize the modal (only once), and then set the content of the modal dynamically.

@lenamtl
lenamtl / functions.php
Created March 17, 2021 19:41 — forked from dartrax/functions.php
Translate WooCommerce and WooCommerce Germanized mails into order language with TranslatePress before sending
// Save the current language in post_meta when checkout is processed (used to identify correct Email language)
add_action('woocommerce_checkout_update_order_meta', 'dartrax_save_language_on_checkout', 10, 2 );
function dartrax_save_language_on_checkout( $order_id, $posted ) {
if( ! class_exists('TRP_Translate_Press') ) return '';
global $TRP_LANGUAGE;
update_post_meta( $order_id, '_order_language', $TRP_LANGUAGE );
}
// Woocommerce Germanized Mails
add_action( 'woocommerce_gzd_shipment_status_draft_to_shipped_notification', 'dartrax_prepare_locale_for_Mail_with_shipment_id', 5, 1 );
@lenamtl
lenamtl / functions.php
Created March 17, 2021 19:41 — forked from dartrax/functions.php
Translate WooCommerce mails into order language with TranslatePress before sending
// Save the current language in post_meta when checkout is processed (used to identify correct Email language)
add_action('woocommerce_checkout_update_order_meta', 'dartrax_save_language_on_checkout', 10, 2 );
function dartrax_save_language_on_checkout( $order_id, $posted ) {
if( ! class_exists('TRP_Translate_Press') ) return '';
global $TRP_LANGUAGE;
update_post_meta( $order_id, '_order_language', $TRP_LANGUAGE );
}
// Woocommerce Shipment Mails
add_action( 'woocommerce_order_status_processing_to_cancelled_notification','dartrax_prepare_locale_for_Mail_with_order_id', 5, 1 );