Skip to content

Instantly share code, notes, and snippets.

Avatar

Clifford cliffordp

View GitHub Profile
@cliffordp
cliffordp / ghl-agency-menu-colors.css
Last active March 28, 2023 23:09
GoHighLevel Agency-Level Settings: Menu Colors
View ghl-agency-menu-colors.css
/**
* Source of this CSS code: https://gist.github.com/cliffordp/e95725bb9fd18eeeaf6c7d4766d18dcc
* Where to place this CSS code: https://app.gohighlevel.com/settings/company
*/
/* Agency */
.sidebar-v2-agency #sidebar-v2 .default-bg-color,
.sidebar-v2-agency #sidebar-v2.default-bg-color,
/* Locations */
.sidebar-v2-location #sidebar-v2 .default-bg-color,
@cliffordp
cliffordp / sample-exif-data
Created February 25, 2023 14:00 — forked from arunbasillal/sample-exif-data
Sample EXIF data using exif_read_data()
View sample-exif-data
// 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
(
@cliffordp
cliffordp / functions.php
Created February 21, 2023 17:24
Enable shortcodes everywhere
View functions.php
<?php
// https://gist.github.com/cliffordp/48713847d9d22511737aa74b03a891d1 This snippet.
// Site Title
add_filter( 'option_blogname', 'shortcode_unautop');
add_filter( 'option_blogname', 'do_shortcode' );
// Site Info when 'display'
add_filter( 'bloginfo', 'shortcode_unautop');
@cliffordp
cliffordp / functions.php
Created January 20, 2023 18:10
Fix for WP Defender Masked Login not filtering wp_login_url() usage.
View functions.php
<?php
/**
* Fix for WP Defender Masked Login not filtering wp_login_url() usage.
*
* @link https://gist.github.com/cliffordp/9468791d165d1864c39969d12100d13d This snippet.
*/
add_filter( 'login_url', 'cliff_point_to_custom_login_slug', 999, 3 );
function cliff_point_to_custom_login_slug ( $login_url, $redirect, $force_reauth ) {
if( class_exists( '\WP_Defender\Model\Setting\Mask_Login' ) ) {
@cliffordp
cliffordp / functions.php
Last active January 11, 2023 03:42
Advanced Custom Fields: support shortcodes in each field's Message
View functions.php
<?php
/**
* ACF: render shortcodes in Message fields, except on the ACF settings screen.
*
* Does work on ACF Options pages, just not ACF Settings pages.
*
* @link https://gist.github.com/cliffordp/bef4f1c5054555991cccccb058796739 This snippet.
*/
add_filter( 'acf/load_field', function ( array $field ) {
@cliffordp
cliffordp / functions.php
Last active January 11, 2023 22:10
WP Review Slider: allow shortcodes in reviews
View functions.php
<?php
/**
* WP Review Slider: allow shortcodes in reviews.
*
* Requires plugin version 11.5.8 or later.
*
* @link https://gist.github.com/cliffordp/14f9355ff089b871abc4d8c183014900 This snippet.
* @link https://r.freemius.com/646/58358/ Get the plugin.
*/
@cliffordp
cliffordp / functions.php
Last active December 22, 2022 20:12
NotificationX plugin: Custom link location for Google Analytics sourced notifications (default is homepage)
View functions.php
<?php
/**
* NotificationX plugin: Custom link location for Google Analytics sourced notifications (default is homepage).
*
* @link https://gist.github.com/cliffordp/f90a50390f51e98457512a36d02f1ef3 This snippet.
*
* @see \NotificationX\FrontEnd\FrontEnd::link_url
*/
add_filter( 'nx_notification_link_google', function( $link, $post, $entry ){
@cliffordp
cliffordp / functions.php
Last active December 17, 2022 15:53
Redirection plugin: Add support for additional shortcodes. Working as of Redirection v5.3.5
View functions.php
<?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/
@cliffordp
cliffordp / shortcodes-anywhere.php
Created November 21, 2022 22:10
WordPress: Enable shortcodes everywhere
View shortcodes-anywhere.php
<?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');
@cliffordp
cliffordp / ghl-open-chat-widget.js
Created November 21, 2022 01:30
High Level Chat Widget: anything with specified class can open the chat widget -- Demo: https://share.getcloudapp.com/d5uylPyE
View ghl-open-chat-widget.js
// 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.