This file contains 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 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 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 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 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 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 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 | |
*/ |
This file contains 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/duplicate-entry/duplicated', 'gk_run_stuff_after_duplication', 10, 2 ); | |
function gk_run_stuff_after_duplication($duplicated_entry, $entry){ | |
$form_id = $duplicated_entry['form_id']; | |
$form = GFAPI::get_form( $form_id ); | |
$run_on_forms = [92]; //The IDs of the Forms you'd like to affect. To target more forms, use [36,81,12] as an example | |
if( !in_array( $form['id'], $run_on_forms ) ){ |
This file contains 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_datatables_js_options', function( $dt_config, $view_id, $post ) { | |
$run_on_views = [100,200]; //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 ) ){ | |
$dt_config['lengthChange'] = false; | |
$dt_config['paging'] = false; | |
$dt_config['searching'] = false; |
NewerOlder