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
// This snippet: https://gist.github.com/cliffordp/927a92f2f2db962673d1deef48a31a0f | |
jQuery(document).ready( function($) { | |
// Hide until Chat Widget loads to prevent ineffective clicks. | |
$( ".open-chat-widget" ).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` |
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
void zohoCRMUpdateNullEntry(string module, string entryId, string fieldNames) | |
{ | |
// This gist: https://gist.github.com/cliffordp/c4590a50b3c8ad6f7add7220481e0082 | |
// Based on https://help.zoho.com/portal/en/community/topic/how-can-i-clear-out-a-value-in-a-field-or-set-it-to-null-using-zoho-flow | |
// But this one allows blanking out multiple comma-separated fields at once | |
// Example module = "Leads" (without quotes in Zoho Flow) | |
// Example fieldNames = "Street,City,State,Zip_Code" (without quotes in Zoho Flow) | |
optionalFields = Map(); | |
fields = fieldNames.toList(","); | |
for each field in fields |
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
map addressToCoordinates(string addressString) | |
{ | |
/** | |
* This snippet: https://gist.github.com/cliffordp/068b32913ba25d1cd998507398c950c8 | |
* | |
* Get lat/long from Google. | |
* https://developers.google.com/maps/documentation/geocoding | |
* | |
* CRM limits Decimal Fields to 9 digits, which is sufficient: | |
* https://rapidlasso.com/2019/05/06/how-many-decimal-digits-for-storing-longitude-latitude/ |