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 | |
/** | |
* Formality hooks reference | |
* | |
* @link https://formality.dev | |
* @since 1.1 | |
* @package Formality | |
* @author Michele Giorgi <[email protected]> | |
*/ |
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('.lightbox-trigger').click( function() { | |
var image = jQuery(this).attr('src'); | |
jQuery('.lightbox-popup').css('background-image', 'url(' + image + ')'); | |
var caption = jQuery(this).next().text(); | |
jQuery('.lightbox-popup-caption').text( caption ); | |
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 | |
/* | |
Official Gravity Forms documentation on get_entries() found here: | |
https://docs.gravityforms.com/api-functions/#get-entries | |
*/ | |
/* Gravity Form ID. */ | |
$form_id = '20'; | |
/* Sorting options avalable but left blank for simplicity. */ |
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 | |
/** | |
* Author:Wajdi Jurry <[email protected]> (https://github.com/wajdijurry) | |
* Gist: https://gist.github.com/wajdijurry/a00752123134342ccc9d13a480c9f013 | |
*/ | |
class ArrayManipulation | |
{ | |
private $array; | |
public function __construct(array $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 | |
$data = array( | |
"fields" => array( | |
"Name" => "Hello world" | |
) | |
); | |
$data_json = json_encode($data); | |
$ch = curl_init("https://api.airtable.com/v0/YOUR_BASE_ID/YOUR_TABLE_NAME?api_key=YOUR_API_KEY"); |
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 | |
do_action('get_header'); | |
//get_template_part('templates/header'); | |
?> | |
<?php //get_template_part('templates/partials/breadcrumbs'); ?> | |
<?php //get_template_part('templates/base'); ?> | |
<?php if( have_rows('gallery') ): $i=0;?> |
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 | |
/** | |
Get all field IDs or field slugs or field labels from a Caldera Form | |
*/ | |
//Get form config | |
$form = Caldera_Forms_Forms::get_form( 'CF58c1e0a4d7c27' ); | |
//Get all fields in order | |
$fields = Caldera_Forms_Forms::get_fields( $form, true ); |
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 | |
/** | |
* Delete all form configs, but no entries. | |
*/ | |
$forms = Caldera_Forms_Forms::get_forms( false, true ); | |
foreach ( $forms as $form ){ | |
Caldera_Forms_Forms::delete_form( $form ); | |
} |
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 | |
/** | |
* Get a field value and send to remote API | |
*/ | |
add_action( 'caldera_forms_submit_complete', function( $form, $referrer, $process_id ) { | |
//change your form ID here | |
if( 'cf123..' != $form[ 'ID' ] ) { | |
return; | |
} |
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> | |
function ListFieldRowCount( listField, totalField ) { | |
var totalRows = jQuery( listField ).find('table.gfield_list tbody tr').length; | |
jQuery( totalField ).val( totalRows ).change(); | |
} | |
function ListFieldRowTotal( formId, fieldId, totalFieldId ) { | |
var listField = '#field_' + formId + '_' + fieldId; | |
var totalField = '#input_' + formId + '_' + totalFieldId; | |
ListFieldRowCount( listField, totalField ); | |
jQuery( listField ).on( 'click', '.add_list_item', function() { |
NewerOlder