Skip to content

Instantly share code, notes, and snippets.

@ChobPT
ChobPT / elementor-select2-popup-fix.js
Last active December 17, 2023 01:21
Fix Elementor + Select2's conflict on popups
/* Chob 2023
- Place this file on your theme and call it from functions.php OR,
- Simply copy the contents of this file and use Elementor > Code Blocks
to paste this code inside <script></script> tags.
Enjoy!
*/
jQuery(document).ready(function(){
jQuery( document ).on( 'elementor/popup/show', () => {
jQuery('.select2-hidden-accessible').each(function(){
@ChobPT
ChobPT / ssi-include-alternative.js
Last active March 2, 2023 19:08
Find SSI (ServerSide Includes) and load their HTML
/**
* Finds all HTML comments with the `#include` tag, extracts the file path from the tag,
* loads the contents of the file using an XMLHttpRequest, and inserts the file contents into the
* DOM, next to the comment node. If the file contents contain any script tags, those scripts are
* also added to the DOM and executed.
*
* Author: chob.pt
*
*/
function onDocumentReady() {
@ChobPT
ChobPT / add-to-uptime-robot.php
Created December 29, 2022 11:32
Bulk Add domains to Uptime Robot's Free Plan
<?php
/*
This will add a bulk amount of domains to Uptimee Robot,
did this due to having a massive new amount of clients
and wanting to streamline the pricess
The function was built with the help of AI, I've corrected some stuff and added some workarounds for time limits and etc.
Tested to be working, needed a couple of runs to prevent duplicate domains from being added again
@ChobPT
ChobPT / wc-bookings-availability-search-shortcode.php
Last active February 5, 2024 12:14 — forked from apintocr/wc-bookings-availability-search.php
WooCommerce Bookings Availability Search Shortcode
<?php
/*
* This code uses the original function and
* adds a shortcode functionality to display the product loop with
* the products that are available adding also another shortcode for
* products that are unavailable
*
* Usage: [bookable_products start="2019-10-10" end="2019-10-15"]
* [unbookable_products start="2019-10-10" end="2019-10-15"]
*