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 | |
// Force list view for search results | |
// updated to the code provided by a forum user at https://theeventscalendar.com/support/forums/topic/forcing-list-view-for-search-results/#post-1259085 | |
// UNTESTED! | |
// from https://gist.github.com/cliffordp/a473ccda4308acb9ac66499de5407c9b | |
add_action( 'wp_footer', function () { | |
// If tribe-events.js hasn't been setup, do nothing | |
if ( ! wp_script_is( 'tribe-events-calendar-script' ) ) { | |
return; | |
} |
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
// Adapted from https://raddle.me/f/Privacy/3722/how-to-circumvent-cloudflare-s-email-protected-thing-without with the help of chatGPT | |
function fixObfuscatedEmails() { | |
const elements = document.getElementsByClassName('__cf_email__'); | |
for (let i = 0; i < elements.length; i++) { | |
const element = elements[i]; | |
const obfuscatedEmail = element.getAttribute('data-cfemail'); | |
if (obfuscatedEmail) { | |
const decodedEmail = decrypt(obfuscatedEmail); | |
element.setAttribute('href', 'mailto:' + decodedEmail); | |
element.innerHTML = decodedEmail; |
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
gh issue list -s all -L 500 --json number | \ | |
jq -r '.[] | .number' | \ | |
xargs -I% gh issue transfer % https://github.com/<destination repo> |
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://www.youtube.com/watch?v=oA2EV7Gz5NM | |
const street = ZDK.Page.getField('Street').getValue(); | |
const city = ZDK.Page.getField('City').getValue(); | |
const zipCode = ZDK.Page.getField('Zip_Code').getValue(); | |
const country = ZDK.Page.getField('Country').getValue(); | |
const state = ZDK.Page.getField('State').getValue(); | |
const address = `${street} ${city} ${state} ${zipCode} ${country}`; | |
const url = `http://api.positionstack.com/v1/forward` |
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
// EXIF data extracted using exif_read_data() PHP function from https://github.com/ianare/exif-samples/blob/master/jpg/Canon_40D.jpg | |
Array ( | |
[FileDateTime] => 0 | |
[FileSize] => 7958 | |
[FileType] => 2 | |
[MimeType] => image/jpeg | |
[SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP | |
[COMPUTED] => Array | |
( |
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 | |
/** | |
* Make sure the function does not exist before defining it | |
*/ | |
if( ! function_exists( 'remove_class_filter' ) ){ | |
/** | |
* Remove Class Filter Without Access to Class Object | |
* | |
* In order to use the core WordPress remove_filter() on a filter added with the callback |
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 | |
// Remove in-post settings for the Genesis Framework, including SEO, layout, and scripts. | |
// Relevant Genesis code can be found in theme's lib > admin > inpost-metaboxes.php | |
if( ! function_exists( 'cliff_genesis_simplify_editing_screens' ) ) { | |
/** | |
* Remove in-post Genesis settings by post type. | |
* @link https://gist.github.com/cliffordp/744a19f00565051924ec7f0d46ac687e This snippet. | |
*/ | |
function cliff_genesis_simplify_editing_screens() { |
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 | |
/** | |
* Quick hack to preview WooCommerce e-mails. | |
* Based on drrobotnik's answer from Stack Overflow: http://stackoverflow.com/a/27072101/186136 | |
* | |
* Add this to <yourtheme>/functions.php and then visit a url like: | |
* http://<site_url>/wp-admin/admin-ajax.php?action=previewemail | |
* | |
* @return null | |
*/ |
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
# Don't load custom stuff if LocalWP shell | |
if [[ -z ${PHPRC+z} ]] | |
then | |
echo "Export custom binaries" | |
# Eg. | |
# export PATH="/opt/homebrew/opt/php@7.4/bin:$PATH" | |
# export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH" | |
fi |
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 | |
// From https://gist.github.com/cliffordp/ab1f7c4d95723ee6f892/, a fork of https://gist.github.com/jesseeproductions/2b1af6527b7029eaea6e | |
// References: | |
// https://theeventscalendar.com/support/forums/topic/ical-only-pushing-1-month-at-a-time/ | |
// https://theeventscalendar.com/support/forums/topic/how-users-can-subscribe-to-my-events-calendar-in-their-personal-calendars/#post-1022932 | |
// https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/3777092-subscribe-to-calendar-via-ical | |
/* | |
* The Events Calendar Get Events for 1 Year from Today in iCal Export File | |
* add coding to child theme's functions.php | |
* Tested works with The Events Calendar v3.12 and v4.0 |
NewerOlder