Skip to content

Instantly share code, notes, and snippets.

View geekontheroad's full-sized avatar

geekontheroad

View GitHub Profile
@geekontheroad
geekontheroad / php-html-css-js-minifier.php
Created February 6, 2022 09:04 — forked from Rodrigo54/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@geekontheroad
geekontheroad / woo-events.js
Created October 14, 2021 14:30 — forked from bagerathan/woo-events.js
[Woocommerce Javascript events] #woo
//Woocommerce Checkout JS events
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
//Woocommerce cart page JS events
$( document.body ).trigger( 'wc_cart_emptied' );
$( document.body ).trigger( 'update_checkout' );
@geekontheroad
geekontheroad / gf-custom-merge-tags.php
Last active July 12, 2021 03:18 — forked from uamv/gf-custom-merge-tags.php
Add custom merge tags to Gravity Forms
<?php
add_filter( 'gform_replace_merge_tags', 'gotrcustom_merge_tags', 10, 7 );
function gotr_custom_merge_tags( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) {
$custom_merge_tags = array(
'{date_ymd}' => date( 'Y.m-M.d', strtotime( $entry['date_created'] ) ),
'{timestamp}' => time(),
'{site_url}' => get_site_url(),
'{site_name}' => get_bloginfo( 'name' )