Skip to content

Instantly share code, notes, and snippets.

View gbissland's full-sized avatar

Gareth Bissland gbissland

View GitHub Profile
@gbissland
gbissland / devitkit.php
Created March 8, 2025 04:16
Configure DevKit error logs for Nginx Error logs on Gridpane
<?php
/**
* DevKit related tweaks
* https://dplugins.com/downloads/devkit/
*
* Must be included in functions.php
*
* @package GenerateChild
*/
@gbissland
gbissland / gp_global_color_grid.php
Last active January 14, 2025 20:33
GP Global Color Grid (for Styleguide)
<?php
/**
* Remove this opening PHP tag when adding to your theme's functions.php
* It's included here for proper syntax highlighting in the gist.
*/
/**
* Displays an grid of the GeneratePress global color palette with color blocks.
* Built to use on website style guides with Beaver Builder but can be used anywhere.
* Global Colors must be set in the GP Customiser
@jodzeee
jodzeee / gist:dd5e65759ae0d386d369c95de4d69d5b
Created January 6, 2025 21:09
Gravity Forms - send to spam if URLs or email in text field
<?php
add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_urls_and_emails', 11, 3 );
function filter_gform_entry_is_spam_urls_and_emails( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}
$field_types_to_check = array(
'hidden',
@Pross
Pross / functions.php
Created August 20, 2024 12:53
Show in pages list if BB layout has unpublished changes
add_filter( 'display_post_states', function( $post_states, $post ) {
if ( get_post_meta( $post->ID, '_fl_builder_enabled', true ) ) {
$draft = get_post_meta( $post->ID, '_fl_builder_draft', true );
$live = get_post_meta( $post->ID, '_fl_builder_data', true );
if ( '' !== $draft && $draft != $live ) {
$post_states['bb_draft'] = 'Unpublished Changes';
}
}
@pstoute
pstoute / wpumbrella-http-context.conf
Created November 17, 2023 21:01
This is the http context file that you need to add to whitelist the IP addresses for WP-Umbrella
geo $wpumbrella_ips {
default 0;
2001:41d0:306:1702::/64 1;
141.95.192.2 1;
}
@pstoute
pstoute / fortress-uabb-gf-override.php
Created June 28, 2023 20:01
This must use plugin gets added to the /wp-content/mu-plugins directory and requires no configuration to allow the fortress 2fa pages to display all by setting the gravity forms force hooks js output to false on pages including /snicco-fortress
<?php
/**
* Plugin Name: GridPane Fortress - UABB Gravity Forms Styler Override
* Description: This must use plugin overrides the Ultimate Addons forced filter to return false on fortress related pages.
* Version: 1.0
* Author: Stoute Web Solutions
* Author URI: https://stoutewebsolutions.com/
* Plugin URI: https://community.gridpane.com/t/ultimate-addons-for-beaver-builder-breaks-fortress-2fa-page-third-party/3333/80
*/
@alanzchen
alanzchen / popclip-chatgpt.js
Last active February 20, 2025 14:06
PopClip Actions using ChatGPT.
// #popclip extension for ChatGPT
// name: ChatGPT Quick Actions
// icon: iconify:logos:openai-icon
// language: javascript
// module: true
// entitlements: [network]
// options: [{
// identifier: apikey, label: API Key, type: string,
// description: 'Obtain API key from https://platform.openai.com/account/api-keys'
// }]
@AchalJ
AchalJ / code.php
Last active October 8, 2022 01:28
PP Taxonomy Term - Custom Shortcode to get term image URL
<?php // ignore this
// Copy the code below to your current theme's functions.php file.
// Uses: [get_term_image_url] or [get_term_image_url term_id="PROVIDE TERM ID HERE"]
add_shortcode( 'get_term_image_url', function( $atts ) {
$term_id = 0;
if ( isset( $atts['term_id'] ) && ! empty( $atts['term_id'] ) ) {
$term_id = $atts['term_id'];
} else {
@diggeddy
diggeddy / Add featured image to menu iems
Created July 26, 2022 13:32
Menu Item Featured Image
.fl-builder-content .fill .fl-button-wrap a.fl-button,
.fl-builder-content .fill-outline .fl-button-group-button:nth-child(1) .fl-button-wrap a.fl-button,
.fl-builder-content .outline-fill .fl-button-group-button:nth-child(2) .fl-button-wrap a.fl-button {
font-family: var(--buttonFontFamily,var(--fontFamily));
font-size: var(--buttonFontSize);
font-weight: var(--buttonFontWeight);
font-style: var(--buttonFontStyle);
letter-spacing: var(--buttonLetterSpacing);
text-transform: var(--buttonTextTransform);
-webkit-text-decoration: var(--buttonTextDecoration);