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 // Hourly Cron & Orphaned Entry Expiration | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
function gpnf_custom_hourly_cron() { | |
if( ! is_callable( 'gp_nested_forms' ) ) { | |
return; | |
} |
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 // Limit Submissions // Value-specific Limits by Field | |
* http://gravitywiz.com/documentation/gravity-forms-limit-submissions/ | |
* | |
* Form Export: https://gwiz.io/2Nm2JC2 | |
* Feed Config: https://gwiz.io/2GJ2mRV | |
*/ | |
// Update "123" to your form ID. | |
add_filter( 'gpls_rule_groups_123', function( $groups ) { |
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
wp s3-uploads migrate-attachments --delete-local |
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 | |
/** | |
* GravityView doesn't trigger the `gform_after_submission` action when editing entries. This does that, | |
* but ONLY FOR FORM #12. | |
* | |
* @param array $form | |
* @param int $entry_id ID of the entry being updated | |
* @param GravityView_Edit_Entry_Render $object | |
* |
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 // Re-order Display Fields | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
// Update "123" to your form ID. | |
add_filter( 'gform_pre_render_123', function( $form ) { | |
foreach( $form['fields'] as &$field ) { | |
// Update "2" to your Nested Form field ID. | |
if( $field->id = 2 ) { |
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 // Copy Parent Entry Properties on Parent Form Submission | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
// Update "123" to your parent form ID. | |
add_action( 'gform_entry_created_123', function( $entry, $form ) { | |
// Specify which properties you would like to populate from the parent. | |
// Supports: id, form_id, post_id, date_created, is_starred, is_read, ip, source_url, user_agent, currency, payment_status, payment_date, payment_amount, payment_method, transaction_id, is_fulfilled, created_by, transaction_type, status, date_updated, last_payment_date |
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( 'woocommerce_product_categories_widget_args', 'yanco_woocommerce_product_categories_widget_args', 10, 1 ); | |
add_filter( 'woocommerce_product_categories_widget_dropdown_args', 'yanco_woocommerce_product_categories_widget_args', 10, 1 ); | |
function yanco_woocommerce_product_categories_widget_args( $list_args ) { | |
$exclude_array = array(); | |
$exclude_args = array( | |
'taxonomy' => 'product_cat', | |
'meta_query' => 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 | |
/** | |
* Modify the REST response sent by GravityView to use GF form field labels instead of field IDs | |
*/ | |
add_filter( 'rest_pre_echo_response', function( array $result, WP_REST_Server $server, WP_REST_Request $request ) { | |
if ( empty( $result['entries'] ) ) { | |
return $result; | |
} |
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 // GP eCommerce Fields // Set Tax Amount Dynamically | |
* https://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/ | |
*/ | |
add_filter( 'gform_pre_render_123', 'gpecf_dynamic_tax_amount' ); | |
add_filter( 'gform_pre_validation_123', 'gpecf_dynamic_tax_amount' ); | |
add_filter( 'gform_pre_submission_filter_123', 'gpecf_dynamic_tax_amount' ); | |
add_filter( 'gform_admin_pre_render_123', 'gpecf_dynamic_tax_amount' ); | |
function gpecf_dynamic_tax_amount( $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 | |
/** | |
* When an entry is updated in Gravity Forms Edit Entry or Gravity Forms API, unapprove it | |
*/ | |
add_action( 'gform_after_update_entry', function( $form, $entry_id, $original_entry ) { | |
if ( ! is_admin() ) { | |
// return; # Uncomment if you want to run this only in the Edit Entry screen, not also in API requests | |
} |