This file contains 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
"use strict"; | |
const getHashPath = () => { | |
const href = window.location.href; | |
const hashIndex = href.indexOf('#'); | |
return hashIndex === -1 ? '' : href.substring(hashIndex + 1); | |
}; | |
const pushHashPath = path => window.location.hash = path; | |
const replaceHashPath = path => { |
This file contains 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
# Check: https://onexa.nl/wordpress/toolbar-link-redis-object-cache/ | |
/** | |
* Add a link to the Admin Toolbar to easily flush the Redis cache (Redis Object Cache plugin) | |
* | |
* @author Hiranthi Herlaar, onexa.nl | |
* | |
* @var $wp_admin_bar > https://codex.wordpress.org/Class_Reference/WP_Admin_Bar | |
**/ | |
function redis_add_toolbar_link( $wp_admin_bar ) | |
{ |
This file contains 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 | |
function lazyloadImages($html) { | |
$matches = array(); | |
preg_match_all( '/<img[\s\r\n]+.*?>/is', $html, $matches ); | |
$search = array(); | |
$replace = array(); | |
foreach ( $matches[0] as $imgHTML ) { |
This file contains 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 | |
/** | |
* Plugin Name: WooPAM: Woo Product Attributes Modifier | |
* Description: Bulk update 'custom meta product attributes' to 'taxonomy product attributes' in WooCommerce. Supports the GET variables, like: woopam_mode=run&woopam_from_attribute_meta=colour&woopam_to_attribute_tax=pa_colour&woopam_keep_attribute_meta&woopam_posts_per_page=10&woopam_paged=0&woopam_post_type=product&woopam_post_status=any. WARNING: Backup DB first!!! | |
* Plugin Author: birgire | |
* Author URI: https://github.com/birgire | |
* Plugin URI: https://gist.github.com/birgire/0ed300ae4436fcaf508c | |
* Version: 1.0.0 | |
* License: GPL2+ | |
* Text Domain: woopam |