Skip to content

Instantly share code, notes, and snippets.

View geekontheroad's full-sized avatar

geekontheroad

View GitHub Profile
<?php
/**
* Snippet For Gravity Perks Google Sheets
*
* Description: Create a daily spreadsheet for your feed. The spreadsheet will be created after the first entry of that day.
*
* Instructions: Copy this code to your functions.php and enter your form id and feed ids at the bottom in the configuration section
*
* @author Johan d'Hollander
* @link https://geekontheroad.com
<?php
/**
* Geek on the Road // GP Nested Forms
*
* Description: Populate child entries from one parent form into another parent form with a different child form
* Version: 0.1
* Author: Johan d'Hollander
* Author URI: https://geekontheroad.com
*
@geekontheroad
geekontheroad / euvat-hide-field-description.php
Last active August 18, 2023 13:39
Hide the description of the EU VAT field when outside of EU
<?php
/**
* This snippet is meant for the EU VAT for Gravity Forms addon
* It will hide the EU VAT field description when a country outside of Europe is selected
*
* INSTRUCTIONS
* Copy to your functions.php or code snippet plugin. Dont copy the starting <?php tags
*
* @author Johan d'Hollander
* @link https://geekontheroad.com
@geekontheroad
geekontheroad / default_to_base_country_vat.php
Last active August 11, 2023 04:33
This snippet is made for the EU VAT for Gravity Forms. It can apply the tax rate of the default country to all other EU countries.
<?php
/**
* Snippet to apply the tax rate of the base country to ALL EU countries
*
* @param Int $rate
* @param string $country_code the 2 digit ISO code of the country *
* @return Int $rate
* @version 1.0
* @link https://geekontheroad.com/eu-vat-for-gravity-forms/
@geekontheroad
geekontheroad / add-suffix-or-prefix-to-value-in-summary.html
Last active July 17, 2023 07:40
Add a suffix or prefix to the Gravity forms Live Summary
<!----
* EXAMPLE 1: ADD SUFFIX TO A VALUE IN THE GF LIVE SUMMARY
*
* The below code can be used to add a suffix to any field in the Gravity Forms Summary.
* IMPORTANT: You need the Live Summary for Gravity forms addon with a minimum version of 1.1.14.1 installed
*
* INSTRUCTIONS
* 1. Add a new HTML field to your form and copy the code (including <script> tags) to the html field
* 2. Update the fieldsIds array with a comma separated list of your fields that need a suffix.
* 3. Update the suffix variable to your desired suffix
@geekontheroad
geekontheroad / gravity-and-addEvent.php
Created June 5, 2023 12:36
Use gravity forms to create a new attendee for a RSVP list in addEvent.com
<?php
/**
* simple function that will create a new attendee to an Event in addEvent
*
* Works with gravity forms by hooking into the gform_after_submission
***/
function gotr_create_attendee($entry, $form) {
$url = "https://www.addevent.com/api/v1/oe/rsvps/attendee/create/";
$token = "XX_YOUR_TOKEN_HERE_XX"; //AddEvent Token
$eventId = "XX_EVENT_ID_HERE_XX"; //The event Id in AddEvent
<?php
/**
* Simple function to add a download PDF button to the Projectopia invoice overview
*
* @author Johan dhollander
* @link https://geekontheroad.com
* **/
function gotr_add_download_pdf_link_to_row_actions($actions, $post) {
if ($post->post_type === 'cqpim_invoice') {
@geekontheroad
geekontheroad / change-transaction-id.php
Last active May 31, 2023 01:42
GF coinbase commerce change transaction id mergetag
<?php
/**
* Snippet for Coinbase Commerce for gravity forms
* This will replace the value of the transaction id mergetag with the value of the cc_order_id meta
*
* INSTRUCTIONS
* Copy this to your functions.php of your child theme. Use a code snippets plugin if you dont have the child theme
* Make sure to omit the <?php tag when copying to functions.php
*
@geekontheroad
geekontheroad / remove_astra_gravity_forms_styles.php
Created May 14, 2023 06:34
Removes the Astra styling for gravity forms
<?php
/**
* The CSS added by the Astra theme conflicts with GF styling especially with the new Orbital styling
* This script unloads the Astra CSS for gravity forms to fix this problem
*
* @author https://geekontheroad.com
**/
//unload astra styles for gravity forms as they make things worse
@geekontheroad
geekontheroad / wp_all_enqueued_css_shortcode.php
Last active May 14, 2023 06:32
Adds a new shortcode that will output a list of all CSS that is loaded for that page with their handle and file location.
<?php
/**
* This will output all styles with their handle and file location
*
* Shortcode: [gotr_enqueued_css]
*
* @author https://geekontheroad.com
***/
function gotr_enqueued_css_shortcode() {