Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Travis Lopes travislopes

🎯
Focusing
Block or report user

Report or block travislopes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fg_entryautomation_search_criteria.php
<?php
add_filter( 'fg_entryautomation_search_criteria', 'only_automate_failed_payments', 10, 3 );
function only_automate_failed_payments( $search_criteria, $feed, $form ) {
$search_criteria['field_filters'][] = array( 'key' => 'payment_status', 'value' => 'Failed' );
return $search_criteria;
View Generate Many Fake Entries.php
<?php
require_once GFCommon::get_base_path() . '/tests/gravityforms-factory.php';
// Get forms.
$forms = GFAPI::get_forms();
// Loop through forms.
foreach ( $forms as $form ) {
View fg_fillablepdfs_pdf_args.php
<?php
add_filter( 'fg_fillable_pdf_args', 'add_list_field_to_pdf', 10, 4 );
function add_list_field_to_pdf( $pdf_meta, $feed, $entry, $form ) {
// Prepare column names for each day of the week.
$column_names = array(
'Sunday %d',
'Monday %d',
View fg_easypassthrough_populate_same_form.php
<?php
add_filter( 'fg_easypassthrough_populate_same_form', '__return_false' );
View LimitDate.js
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
if ( formId == 12 && fieldId == 1 ) {
optionsObj.maxDate: -1
}
return optionsObj;
} );
View fg_entryautomation_export_email_subject.php
<?php
add_filter( 'fg_entryautomation_export_email_subject', 'subject_date_range', 10, 4 );
function subject_date_range( $subject, $settings, $form, $file_name ) {
// Get search criteria.
$search_criteria = fg_entryautomation()->get_search_criteria( $settings, $form );
// Add date range to subject.
View fg_entryautomation_maximum_attachment_size.php
<?php
add_filter( 'fg_entryautomation_maximum_attachment_size', 'increase_attachment_size', 10, 4 );
function increase_attachment_size( $maximum_file_size, $settings, $form, $file_name ) {
return 10485760;
}
View fg_entryautomation_export_email_message.php
<?php
add_filter( 'fg_entryautomation_export_email_message', 'add_payment_summary', 10, 4 );
function add_payment_summary( $message, $settings, $form, $file_name ) {
// Get search criteria.
$search_criteria = fg_entryautomation()->get_search_criteria( $settings, $form );
// Get entries for search criteria.
@travislopes
travislopes / Auto Open Field Settings.js
Last active Feb 24, 2017
This code snippet will automatically open the Gravity Forms field settings pane and navigate to the desired tab on page load.
View Auto Open Field Settings.js
/***
* This code snippet will automatically open the field settings
* pane and navigate to the desired tab on page load.
*
* To use, just add the tab to the hash of the page URL:
* http://example.com/wp-admin/admin.php?page=gf_edit_forms&id=1#tab=gform_tab_1
*
* By default, the first field in the form will be opened.
* To open a different field, add a field ID parameter:
* http://example.com/wp-admin/admin.php?page=gf_edit_forms&id=1#tab=gform_tab_1&field=4
View gist:687b10d58f3d5208be925369399b8496
/**
* Custom account fields
*/
add_action( 'woocommerce_edit_account_form', 'my_woocommerce_edit_account_form' );
add_action( 'woocommerce_save_account_details', 'my_woocommerce_save_account_details' );
function my_woocommerce_edit_account_form() {
$user_id = get_current_user_id();
You can’t perform that action at this time.