Skip to content

Instantly share code, notes, and snippets.

View erickarbe's full-sized avatar

Erick Arbé erickarbe

View GitHub Profile
@erickarbe
erickarbe / functions.php
Created October 28, 2021 16:53
Send Gravity Form Data to a Custom Post Type with Advanced Custom Fields (ACF)
// Change "_2" to the ID of the form
add_action( 'gform_after_submission_2', 'add_to_awardpost', 10, 2 );
function add_to_awardpost($entry, $form) {
// Create the variables
$facility_name = rgar($entry, '1' );
$primary_contact_name = rgar($entry, '2' );
$primary_contact_title = rgar($entry, '3');
$primary_contact_email = rgar($entry, '4');
@erickarbe
erickarbe / functions.php
Created February 7, 2022 18:31
add netlify tags to gravity forms
//Add Netflify tag to GForms
add_filter( 'gform_form_tag', 'form_tag_netlify', 10, 2 );
function form_tag_netlify( $form_tag, $form ) {
$form_name = $form['title'];
$form_tag = str_replace( "<form ", "<form name='{$form_name}' data-netlify='true' action='/pages/success' ", $form_tag );
return $form_tag;
}
@erickarbe
erickarbe / square-website-builder-custom-css.js
Created April 11, 2022 15:29
How to add custom css to a square website
<script>
var parentWindow = window.parent;
// Create our stylesheet
var style = parentWindow.document.createElement('style');
style.innerHTML = `#YOUR_SELECTOR_HERE {max-width: 100% !important; padding: 0; overflow: hidden; }`;
// Get the first script tag
var ref = parentWindow.document.querySelector('script');