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 | |
// Add this to wp-content/mu-plugins/metaslider-dynamic-loading.php | |
// Update the id to include the slideshows you want to use | |
// Works best with "fade" transitions | |
$slideshow_id = ['34', '123']; | |
// $slideshow_id = ['34']; | |
// TODO: Accept a color background option and an optional loading icon. |
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 | |
$key = YOUR_API_KEY; | |
$workspace = '2385201'; // Your team workspace | |
$curl = curl_init(); | |
if (!$curl) { | |
die("Couldn't initialize a cURL handle"); | |
} |
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
// ==UserScript== | |
// @name WP Support Live Preview | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://wordpress.org/support/* | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Filter unwanted AlpineJS attributes from Tailwind UI components | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove Alpine JS code from Tailwind Ui copy/paste | |
// @author https://github.com/KevinBatdorf | |
// @match https://tailwindui.com/components/* | |
// @grant none | |
// ==/UserScript== | |
const code = document.querySelectorAll('[x-ref=clipboardCode]') |
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
// ==UserScript== | |
// @name Add AlpineJs to Tailwind UI | |
// @namespace http://tampermonkey.net/ | |
// @version 3.0 | |
// @description Add Alpine JS code to Tailwind Ui copy/paste | |
// @author https://gist.github.com/KevinBatdorf/8bd5f808fff6a59e100dfa08a7431822 | |
// @match https://tailwindui.com/components/* | |
// @grant none | |
// ==/UserScript== |
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
window.jQuery(function($) { | |
$('div[class*=wp-featherlight] .youtube').each(function(index, video) { | |
window.addEventListener('load', function () { | |
setTimeout(function() { | |
$(video).data('lazyLoad', 0); | |
}, 1000); | |
}); | |
$(video).wrap( | |
'<a data-featherlight-iframe-width="1920" '+ |
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
import { checkForAlpine } from './utils' | |
const AlpineTruncateMagicMethod = { | |
start() { | |
checkForAlpine() | |
Alpine.addMagicProperty('truncate', () => { | |
return (...parameters) => { | |
if (typeof parameters[0] !== 'string') return parameters[0] |
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
// Demo; https://codepen.io/KevinBatdorf/pen/RwGEdpr?editors=1011 | |
// Load in before you load Alpine | |
function AlpineAutoInitChildren() { | |
// Use: <div x-data x-init="$initChildren()"> | |
Alpine.addMagicProperty('initChildren', ($el) => { | |
return () => { | |
// Grab all child x-init. Customize if you want to only run based on a specific condition | |
Array.from($el.querySelectorAll('[x-init]')).forEach(child => { | |
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 | |
// Requires MS Lightbox | |
add_filter('metaslider_lightbox_supported_plugins', function ($attributes) { | |
return [ | |
'Easy FancyBox' => [ | |
'location' => 'easy-fancybox/easy-fancybox.php', | |
'settings_url' => 'options-media.php', | |
'rel' => 'lightbox', | |
] | |
]; |