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
let cache = new Map(); | |
let pending = new Map(); | |
function fetchTextSync(url) { | |
if (cache.has(url)) { | |
return cache.get(url); | |
} | |
if (pending.has(url)) { | |
throw pending.get(url); | |
} |
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 | |
/** | |
* Thanks for James Kemp / Iconic turning the idea into a plugin | |
* https://wordpress.org/plugins/shortcode-pagination-for-woocommerce | |
* | |
* This code shows pagination for WooCommerce shortcodes when it's embeded on single pages. | |
* Include into functions.php. | |
*/ | |
if ( ! is_admin() ) { |