This file contains hidden or 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 | |
/** | |
* Gets gravity form entries for the given user. This includes entries where the user was logged in when they submitted the entry, and entries | |
* that were used to create their account with the GF User Registration Addon. | |
* | |
* @param $user_id | |
* | |
* @return array | |
*/ |
This file contains hidden or 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 | |
// 1/3) Usage: | |
$entry_id = 100; // usually provided in a filter, if so you can remove this line. | |
$entry = GFAPI::get_entry( $entry_id ); // get the entry, if this was provided in a filter you can remove this line. | |
$field_id = 35; // field ID can be found when field is selected while editing the form | |
$value = rs_gf_get_checked_boxes( $entry, $field_id ); | |
// 2/3) Example output: |
This file contains hidden or 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
/** | |
* Convert RGB to Hex. Allows whitespace. If given hex, returns that hex. Alpha opacity is discarded. | |
* Supports formats: | |
* #fc0 | |
* #ffcc00 | |
* rgb( 255, 255, 255 ) | |
* rgba( 255, 255, 255, 0.5 ) | |
* rgba( 255 255 255 / 0.5 ) | |
*/ | |
function rgb_any_to_hex( orig ) { |
This file contains hidden or 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 | |
/** | |
* When updating a post, user, or term, ensure specific fields have a blank entry in the database even when null. | |
* | |
* @param $object_id | |
* @param null $type | |
* @param null $subtype | |
*/ | |
function rs_insert_missing_meta_keys_on_save( $object_id, $type = null, $subtype = null ) { |
This file contains hidden or 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 | |
// Make every gravity form field add its input type as a class. | |
// Example (added class: gfield-type-radio): | |
// fieldset id="field_136_31" class="gfield gfield-type-radio ..." | |
// Some other types: name, email, html, select, ... | |
function aa_add_input_type_gravity_forms( $form ) { | |
foreach ( $form['fields'] as $field ) { | |
if ( $field instanceof GF_Field ) { | |
$field->cssClass .= 'gfield-type-' . $field->get_input_type(); |
This file contains hidden or 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
{"0":{"title":"Editable Form","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":"","width":"auto","location":"bottom","layoutGridColumnSpan":12},"fields":[{"type":"name","id":1,"formId":12,"label":"Name","adminLabel":"","isRequired":false,"size":"large","errorMessage":"","visibility":"visible","nameFormat":"advanced","inputs":[{"id":"1.2","label":"Prefix","name":"","autocompleteAttribute":"honorific-prefix","choices":[{"text":"Dr.","value":"Dr."},{"text":"Miss","value":"Miss"},{"text":"Mr.","value":"Mr."},{"text":"Mrs.","value":"Mrs."},{"text":"Ms.","value":"Ms."},{"text":"Prof.","value":"Prof."},{"text":"Rev.","value":"Rev."}],"isHidden":false,"inputType":"radio"},{"id":"1.3","label":"First","name":"fname","autocompleteAttribute":"given-name"},{"id":"1.4","label":"Middle","name":"","autocompleteAttribute":"additional-name","isHidden":false},{"id":"1.6","label":"Last","name":"lname","autocompleteAttribute":"family-name"},{"id":"1.8" |
This file contains hidden or 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 | |
// Example long query (2.557 seconds): | |
// @see https://radleysustaire.com/s3/1c66a3/ | |
// Example optimized query (0.316 seconds): | |
// @see https://radleysustaire.com/s3/fb794e/ | |
// Example of what your code would look like: | |
$args = array( | |
'taxonomy' => array( 'account-menu' ), |
This file contains hidden or 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 | |
/* | |
Plugin Name: A+A Gravity Forms Dynamic Progressbar | |
Description: Gravity Forms that use a progressbar for multiple pages will adjust as answers are filled in, rather than only when progressing to the next page. | |
Author: Radley Sustaire, Alchemy + Aim | |
*/ | |
class AA_GF_Dynamic_Progressbar { | |
public function __construct() { |
This file contains hidden or 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
//Imports | |
import crafttweaker.api.tag.MCTag; | |
/* | |
************* | |
* a * b * c * | |
************* | |
* d * e * f * | |
************* | |
* g * h * i * |