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 | |
add_action( 'gravityview/approve_entries/updated', 'gv_approval_timestamp', 10, 2 ); | |
function gv_approval_timestamp($entry_id, $status){ | |
if( !class_exists( 'GFAPI' ) ) { | |
gravityview()->log->error( 'GFAPI does not exist' ); | |
return 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 | |
// 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; |
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/math/shortcode/before', function ( $formula ) { | |
preg_match_all( '/~[^~]*?:(\d+(\.\d+)?|[a-z_]+)(:(.*?))?~/mi', $formula, $merge_tags, PREG_SET_ORDER ); | |
foreach ( $merge_tags as $merge_tag ) { | |
$updated_merge_tag = str_replace( '~', '', $merge_tag[0] ); | |
$updated_merge_tag = sprintf( '{%s}', $updated_merge_tag ); | |
$formula = str_replace( $merge_tag[0], $updated_merge_tag, $formula ); |
NewerOlder