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 | |
$feed = GFAPI::get_feed( 62 ); // replace 62 with the ID of the GP Google Sheets feed | |
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; |
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 - Code shared by Rob Davis | |
namespace GravityView_Refresher_26096; | |
class Refresher { | |
// Form ID in question. | |
public $form_id = 18; | |
// View ID in question. | |
public $view_id = 26096; |
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( 'gv_ratings_reviews_ratings_allowed', function ( $is_allowed, $_, $__, $view ) { | |
if ( ! $is_allowed || ! $view instanceof GravityView_View ) { | |
return $is_allowed; | |
} | |
global $gv_ratings_reviews; | |
$post_bridge_comp = $gv_ratings_reviews->component_instances['post-bridge']; |
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 | |
// Removes Edit Entry "nonce" validation. Edit Entry checks whether an user has the ability to edit an entry, but it also checks a "nonce" to make sure that the Edit Entry link was recently generated by the current user visiting the page. This can sometimes cause problems; this code removes that "nonce" validation. | |
add_filter( 'gravityview/edit_entry/verify_nonce', '__return_true' ); | |
// allow non logged-in users to edit entries | |
add_filter( 'gravityview/edit_entry/user_can_edit_entry', '__return_true' ); | |
add_filter( 'gravityview/capabilities/allow_logged_out', '__return_true' ); | |
add_filter( 'user_has_cap', function( $caps ) { | |
$caps['gravityview_edit_others_entries'] = true; |