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 // DO NOT COPY THIS LINE | |
/** | |
* Change GravityExport Lite export filename. | |
* | |
* Hook: gfexcel_renderer_filename ← all forms | |
* gfexcel_renderer_filename_{ID} ← one specific form | |
* | |
* @param string $filename The filename generated by the plugin. | |
* @param int $form_id (Since v1.6) ID of the form being exported. |
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 // DO NOT COPY THIS LINE | |
function custom_duplicate_gf_entry( $entry_id ) { | |
if ( ! class_exists( 'GravityView_Duplicate_Entry' ) ) { | |
return new WP_Error( 'missing_class', 'GravityView_Duplicate_Entry class not found.' ); | |
} | |
$entry = GFAPI::get_entry( $entry_id ); | |
if ( is_wp_error( $entry ) ) { | |
return $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
add_filter( 'gravityflow_field_filters_status_table', 'field_filters_status_expired', 10, 1 ); | |
function field_filters_status_expired( $field_filters ) { | |
foreach ( $field_filters as $form => $filters ) { | |
if ( $form == '185' ) { // CHANGE 185 WITH YOUR FORM ID | |
$field_filters[ $form ][] = array( | |
'key' => 'is_approved', | |
'text' => 'View Approval Status', | |
'operators' => array ( 'is', 'isnot' ), | |
'values' => array( | |
array( 'value' => '1', 'text' => 'Approved' ), |
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 // DO NOT COPY THIS LINE | |
function custom_cancel_onclick_js( $back_link, $form, $entry, $view_id, $update_count ) { | |
$run_on_views = [2334]; //Change this to the IDs of the Views you'd like to run this filter [100,200,300,...] | |
if( in_array( $view_id, $run_on_views ) ){ | |
return 'window.parent.postMessage({closeFancybox: true}, "*"); return false;'; | |
} | |
} | |
add_filter( 'gravityview/edit_entry/cancel_onclick', 'custom_cancel_onclick_js', 100, 5 ); |
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 // DO NOT COPY THIS LINE | |
add_action( 'gravityview/approve_entries/updated', 'gv_custom_function', 10, 1 ); | |
add_action( 'gravityview/approve_entries/approved', 'gv_custom_function', 10, 1 ); | |
function gv_custom_function( $entry_id ){ | |
$entry = GFAPI::get_entry( $entry_id ); | |
$form = GFAPI::get_form( $entry['form_id'] ); | |
$run_on_views = [100,200]; //Change this to the IDs of the Views you'd like to run this code |
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 // DO NOT COPY THIS LINE | |
add_filter( 'gform_merge_tag_filter', function ( $value, $merge_tag, $modifier, $field, $raw_value ) { | |
if( 'all_fields' !== $merge_tag && 'explode' === $modifier ) { | |
$choices = explode(',', $value); | |
foreach ($choices as $key => $choice) { | |
$output .= $choice.'<br>'; | |
} |
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 // DO NOT COPY THIS LINE | |
add_filter( 'gravityview/edit_entry/form_fields', function ( $gf_fields, $edit_entry_fields, $form, $view_id ) { | |
if ( 1 !== $view_id ) { // Replace 1 with the View ID you want to target. | |
return $gf_fields; | |
} | |
foreach ( $gf_fields as $index => $field ) { | |
if ( 2 === $field->id ) { // Replace 2 with the Field ID you want to hide. | |
unset( $gf_fields[ $index ] ); |
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 // DO NOT COPY THIS LINE | |
// How to use: inside a custom content field, use: [download_links urls="{File Upload:9}"] | |
function shortcode_download_links($atts) { | |
// Capture the shortcode attributes | |
$atts = shortcode_atts( | |
array( | |
'urls' => '', // Default value for the merge tag | |
), | |
$atts |
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 // DO NOT COPY THIS LINE | |
add_filter( 'gravityview_fe_search_criteria', 'gk_exact_field', 10, 2 ); | |
/** | |
* @param array $search_criteria | |
* @param int $form_id | |
* | |
* @return array Modified search, if it's the current form | |
*/ |
NewerOlder