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
class GP_Nested_Forms_Dynamic_Entry_Min_Max { | |
public function __construct( $args = array() ) { | |
// set our default arguments, parse against the provided arguments, and store for use throughout the class | |
$this->_args = wp_parse_args( $args, array( | |
'parent_form_id' => false, | |
'nested_form_field_id' => false, | |
'default_max' => 0, // Max to fallback to if the dependent field isn't populated | |
'default_min' => 0, // Min to fallback to if the dependent field isn't populated |
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
class GP_Nested_Forms_Dynamic_Entry_Min_Max { | |
public function __construct( $args = array() ) { | |
// set our default arguments, parse against the provided arguments, and store for use throughout the class | |
$this->_args = wp_parse_args( $args, array( | |
'parent_form_id' => false, | |
'nested_form_field_id' => false, | |
'default_max' => 0, // Max to fallback to if the dependent field isn't populated | |
'default_min' => 0, // Min to fallback to if the dependent field isn't populated |
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
/** | |
* Gravity Wiz // Gravity Forms // "None of the Above" Checkbox | |
* https://gravitywiz.com/ | |
* | |
* Instruction Video: https://www.loom.com/share/0f8de708790b4afd879bf0632efd7eae (Out of date) | |
* | |
* Use this snippet to enable a proper "None of the Above" option in your Checkbox fields. If any | |
* other option is checked, the "None of the Above" option will be disabled. If the "None of the Above" | |
* option is checked, all other options will be disabled. | |
* |
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
class GPPA_Populate_Child_Entries { | |
public function __construct( $args = array() ) { | |
// do version check in the init to make sure if GF is going to be loaded, it is already loaded | |
add_action( 'init', array( $this, 'init' ) ); | |
} | |
public function init() { |
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 | |
add_filter( 'gppa_has_empty_field_filter_value_85_7', '__return_false' ); | |
add_filter( 'gppa_object_type_filter_after_processing', function ( $query_builder_args, $args ) { | |
$target_form_id = 85; | |
$target_field_id = 7; | |
/** | |
* @var $field | |
* @var $filter_value |
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 | |
// Snippet in Action: https://www.loom.com/share/39512bb9fd7b477fb886d75a85ae0be1 | |
// Helper Method to get all checkbox values from an entry and targetted checkbox field_id | |
// Credits : https://gist.github.com/RadGH/d08a7466b097dfb895ec6dede2e474f5 | |
function rs_gf_get_checked_boxes( $entry, $field_id ) { | |
$items = array(); | |
$field_keys = array_keys( $entry ); | |
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 | |
class GW_Disable_Submit { | |
public static $script_output = false; | |
public function __construct( $form_id ) { | |
add_action( "gform_pre_render", array( $this, 'maybe_output_script' ) ); | |
add_action( "gform_register_init_scripts", array( $this, 'add_init_script' ) ); |
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 | |
/** | |
* Gravity Perks // Nested Forms // Hide Total Column for Non-Logged in Users | |
* https://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
add_filter( 'gp_template_output_nested-entries', function( $markup, $located_template, $load, $args ) { | |
ob_start(); | |
/** | |
* @var array $nested_fields An array of GF_Field objects. | |
* @var array $nested_form The form object of the nested form. |
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 | |
// Loom Demo: https://www.loom.com/share/ace89d21cbd54f3983abfc1a99829686 | |
// customize code line 34 and 65 to include the form_id of your main form which generates the Unique IDs. | |
add_filter( 'gp_template_output_nested-entries', function( $markup, $located_template, $load, $args ) { | |
ob_start(); | |
/** | |
* @var array $nested_fields An array of GF_Field objects. | |
* @var array $nested_form The form object of the nested form. | |
* @var array $nested_field_ids An array of nested field IDs. |
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 | |
add_filter( 'gpeb_entry', function( $entry, $form ) { | |
$svg_star_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none"><g clip-path="url(#a)"><path fill="url(#b)" d="M11.358 4.08 8.12 3.607 6.675.675a.78.78 0 0 0-1.35 0L3.879 3.609l-3.237.47a.75.75 0 0 0-.417 1.28l2.342 2.284-.553 3.224a.75.75 0 0 0 1.088.791L6 10.135l2.895 1.521a.75.75 0 0 0 1.089-.79L9.43 7.641l2.344-2.282a.75.75 0 0 0-.416-1.279h-.001Z"/></g><defs><linearGradient id="b" x1="9.043" x2="8.9" y1="11.165" y2=".684" gradientUnits="userSpaceOnUse"><stop stop-color="#E1A905"/><stop offset="1" stop-color="#F8E193"/></linearGradient><clipPath id="a"><path fill="#fff" d="M0 0h12v12H0z"/></clipPath></defs></svg>'; | |
foreach ( $form['fields'] as $field ) { | |
if ( $field->get_input_type() === 'rating' ) { | |
$selected_value = $entry[ $field->id ]; | |
foreach ( $field->choices as $index => $choice ) { | |
if ( $choice['value'] === $selected_value ) { | |
$entry[ $field->id ] = str_repeat( $svg_star_icon, $index + 1 ); |