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 | |
/** | |
* Redirection plugin: Add support for additional shortcodes. | |
* | |
* Adding support for: [my_shortcode] | |
* !!!You CANNOT call `do_shortcode()` within this function. Just call the shortcode's function directly. | |
* | |
* @link https://gist.github.com/cliffordp/e74f559a523259141a7e95c25a7327fa This snippet. | |
* @link https://redirection.me/support/dynamic-urls/ |
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 | |
// This snippet: https://gist.github.com/cliffordp/e043ad05880e1616ecfcc653935ad35b | |
// Post Titles (including Search Results) | |
add_filter( 'the_title', 'shortcode_unautop' ); | |
add_filter( 'the_title', 'do_shortcode' ); | |
// Text Widgets | |
add_filter( 'widget_text', 'shortcode_unautop'); | |
add_filter( 'widget_text', 'do_shortcode'); |
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
<script id="open-lc-chat-on-clicking-anchor-link"> | |
jQuery(document).ready( function($) { | |
// This snippet: https://gist.github.com/cliffordp/927a92f2f2db962673d1deef48a31a0f | |
// This snippet hides elements with href="#chat" until the Chat Widget loads to prevent ineffective clicks. | |
$('a[href="#chat"]').hide(); | |
$(window).one("LC_chatWidgetLoaded", function() { | |
const chatWidget = window.leadConnector.chatWidget; | |
// Show once Chat Widget is loaded. |
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 | |
/** | |
* Hide Genesis Blocks Pro admin notice about missing license key. Only makes sense if you know you didn't and won't enter one. | |
* | |
* StudioPress is dumb because they'll give give lifetime account holders access to the .zip but not a license key, making it an unnecessary headache to maintain, ugh, sucky. | |
* So here's a snippet to annoy you a little less by not seeing the Genesis Blocks Pro License 'missing' Notification on Admin Screens. | |
* You still need to manually update until StudioPress stops punching us in the face with this nonsense. | |
* | |
* @link https://gist.github.com/cliffordp/37cca6c428d946211dcc9a4127853b33 This snippet. | |
* @link https://developer.wpengine.com/genesis-blocks/changelog/ Genesis Blocks Pro's changelog to watch. |
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
entityMap = crmAPIRequest.toMap().get("record"); | |
/* | |
The example below demonstrates how a field’s value (email) can be obtained from a MAP object. Here, entityMap - Map Object, Email - Field's API name | |
Sample entityMap= {'Email': 'xxx@xxx.com', 'Last_Name': 'xxx'}; | |
*/ | |
amount = entityMap.get("Amount"); | |
deposit = entityMap.get("Deposit"); | |
sendmail | |
[ | |
from :zoho.adminuserid |
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
int ifStringIsBlankOneElseZero(string toCheck) | |
{ | |
// This snippet: https://gist.github.com/cliffordp/9245df1dd6605a9f4ea3bda95d117a76 | |
// https://www.zoho.com/deluge/help/functions/common/isnull-isblank-isempty-difference.html | |
// Unfortunately, isBlank() is not reliable. | |
if(isNull(toCheck) || isEmpty(toCheck)) | |
{ | |
// empty string, string of just spaces | |
return 1; | |
} |
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` |