Skip to content

Instantly share code, notes, and snippets.

@spivurno
spivurno / gw-formula-in-field-descriptions.php
Last active May 15, 2026 12:40
GW Formula in Field Description
<?php
/**
* Plugin Name: GW Formula in Field Description
* Plugin URI: https://gravitywiz.com/
* Description: Displays the configured formula as a code block in the field description for all calculation fields.
* Author: Gravity Wiz
* Version: 0.2
* Author URI: https://gravitywiz.com
*/
@spivurno
spivurno / gw-type-into.php
Created May 13, 2026 21:09
Gravity Wiz Type Into Plugin
<?php
/**
* Plugin Name: Gravity Wiz Type Into
* Plugin URI: https://gravitywiz.com/
* Description: Registers window.gwTypeInto — a utility that simulates human-like typing into any input, textarea, or contenteditable element (including iframes).
* Author: Gravity Wiz
* Version: 1.0
* Author URI: https://gravitywiz.com
*
* Usage (browser console or inline script):
@spivurno
spivurno / gist:c249d86314af31a83c5b5dd2394ac9ae
Created May 12, 2026 12:22
Gravity Connect // API Alchemist // Return CarApi.com Years as Array
<?php
add_filter('gcapi_http_response', function($response_data) {
$request = $response_data['context']['request'];
if ($request && strpos($request->get_url(), 'https://carapi.app/api/years/v2') !== false) {
$response_data['body'] = json_encode( array(
'years' => array_map( function( $year ) {
return array( 'year' => $year );
}, json_decode( $response_data['body'] ) ),
) );
}
@spivurno
spivurno / gw-save-and-continue-to-continue.php
Last active February 22, 2026 12:34
Confirming Email with Gravity Forms Save & Continue (aka Save and Continue to Continue)
<?php
$form_id = 133;
$email_field_id = 6;
$token_field_id = 8;
add_filter( 'gform_incomplete_submission_post_get', function( $submission_json, $token, $form ) use ( $form_id, $token_field_id ) {
$data = json_decode( $submission_json, true );
if ( $form['id'] == $form_id ) {
$data['submitted_values'][ $token_field_id ] = $token;
<?php
add_filter('gpeb_filters_col_rows_query', 'custom_optimize_gf_entry_meta_query_with_cache', 10, 3);
function custom_optimize_gf_entry_meta_query_with_cache($sql, $col, $table) {
// Check if the current table and column are the ones we want to optimize
if ($table === GFFormsModel::get_entry_meta_table_name() && $col === 'meta_key') {
// Attempt to retrieve cached meta_key results
$cached_meta_keys = get_transient('gf_entry_meta_keys');
// If the cache exists, skip running the query
@spivurno
spivurno / how-i-work-template.md
Created June 14, 2023 13:46 — forked from jazzsequence/how-i-work-template.md
Template for How I Like to Work posts

How I work

This is my own interpretation of how I like to work, feedback welcome! Especially if my own view of how I think I like to work doesn't match your experience of how it seems I like to work!

When I work

@spivurno
spivurno / sse.php
Created June 5, 2023 13:16 — forked from jordymeow/sse.php
SSE (Server-Sent Events) with PHP and JS / Streaming with PHP
<?php
// Various links
// https://serverfault.com/questions/488767/how-do-i-enable-php-s-flush-with-nginxphp-fpm
// https://stackoverflow.com/questions/72394213/nginx-configuration-for-server-sent-event
// https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate
// https://qiita.com/okumurakengo/items/cbe6b3717b95944083a1 (in Japanese)
// If '?SSE' is set, send Server-Sent events, otherwise we'll display the page.
if ( isset( $_GET['SSE'] ) ) {
@spivurno
spivurno / gravity-forms-move-progress-bar-bottom.php
Last active October 23, 2023 15:32 — forked from n7studios/gravity-forms-move-progress-bar-bottom.php
Gravity Forms - Move Progress Bar to Bottom of Form
/**
* Plugin Name: Gravity Forms: Move Progress Bar to Bottom of Form
* Plugin URI: http://www.n7studios.co.uk
* Version: 1.0.1
* Author: n7 Studios
* Author URI: http://www.n7studios.co.uk
* Description: Moves the progress bar from the top to the bottom of the Gravity Form. The Start Paging section of the form MUST have a CSS class = progress-bar-bottom
*/
/**
@spivurno
spivurno / gpfup-big-images.css
Last active January 22, 2021 01:35
Gravity Perks // File Upload Pro // Big Images
.gpfup-big-images .gpfup__files {
display: flex;
flex-wrap: wrap;
border: 0;
padding: 0;
box-shadow: none;
margin: 0 -0.5rem;
}
.gpfup-big-images .gpfup__file {
@spivurno
spivurno / gp-limit-choices-shared-limits-field.php
Last active November 10, 2021 19:40
Gravity Perks // Limit Choices // Shared Limits Field
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gp-limit-choices/gplc-shared-choices.php
*/
/**
* Gravity Perks // Limit Choices // Shared Limits Field
*
* Share limits across choices of the same field.