This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceSpace($string){ | |
return str_replace(' ','+',$string); | |
} | |
// Table and data variables | |
$baseid = '###'; //Required | |
$apikey = '###'; //Required | |
$tablename = '###'; //Required | |
$view = ''; //Optional | |
$lookupfieldname = ''; //Optional 1a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script> | |
<script src="/airtable.js"></script> // https://github.com/Airtable/airtable.js/blob/master/build/airtable.browser.js | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | |
<script> | |
// this variable allows you to pull variables from the URL - https://www.learningjquery.com/2012/06/get-url-parameters-using-jquery | |
var getUrlParameter = function getUrlParameter(sParam) { | |
var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="results"></div> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script> | |
<script src="/airtable.js"></script> // https://github.com/Airtable/airtable.js/blob/master/build/airtable.browser.js | |
<script> | |
// this allows you to pull variables from the URL - https://www.learningjquery.com/2012/06/get-url-parameters-using-jquery | |
var getUrlParameter = function getUrlParameter(sParam) { | |
var sPageURL = window.location.search.substring(1), | |
sURLVariables = sPageURL.split('&'), | |
sParameterName, | |
i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
var isvisbuild = $('.et-fb-iframe-ancestor').length; | |
if (isvisbuild == 0){ | |
// code to not run | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* *** add fields from ACF to columns in admin view **** | |
https://pluginrepublic.com/add-acf-fields-to-admin-columns/ | |
CHANGE | |
- manage_model_posts_columns (replace "model" with post type slug) | |
- manage_model_posts_custom_column (replace "model" with post type slug) | |
- model_order (replace with ACF slug) | |
*/ | |
function add_acf_columns ( $columns ) { | |
return array_merge ( $columns, array ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/#example-2 | |
*** CHANGE *** | |
- child_field (this is the dropdown inside the repeater field) | |
- post_slug | |
*/ | |
function acf_pre_populate_repeater_dropdown ( $field ) { | |
$field['choices'] = array(); | |
$args = array('post_type' => 'post_slug'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://docs.gravityforms.com/gform_pre_render/#3-populate-field-with-values-from-earlier-page | |
add_filter( 'gform_pre_render_8', 'populate_user_dropdown_info' ); | |
add_filter( 'gform_pre_validation_8', 'populate_user_dropdown_info' ); | |
add_filter( 'gform_pre_submission_filter_8', 'populate_user_dropdown_info' ); | |
//add_filter( 'gform_admin_pre_render_8', 'populate_user_dropdown_info' ); | |
function populate_user_dropdown_info( $form ) { | |
$current_page = GFFormDisplay::get_current_page( $form['id'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'gform_post_submission_6', 'update_user_info', 10, 2 ); | |
function update_user_info( $entry, $form ) { | |
$userid = rgar($entry,'6'); | |
$email = rgar($entry,'5'); | |
$first_name = rgar($entry,'1.3'); | |
$last_name = rgar($entry,'1.6'); | |
$company = rgar($entry,'4'); | |
$address = rgar($entry,'3'); | |
$password = rgar($entry,'7'); | |
$user_id = wp_update_user( array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'gform_pre_render_6', 'populate_user_info' ); | |
add_filter( 'gform_pre_validation_6', 'populate_user_info' ); | |
add_filter( 'gform_pre_submission_filter_6', 'populate_user_info' ); | |
add_filter( 'gform_admin_pre_render_6', 'populate_user_info' ); | |
function populate_user_info( $form ) { | |
$userid = sanitize_text_field($_GET['userid']); | |
foreach ( $form['fields'] as &$field ) { | |
if ($field->type == 'name'){ | |
$field->inputs[1]['defaultValue'] = get_first_name($userid); |
NewerOlder