Disable Conditional Pricing on GravityView Edit

Code

Filename: gpcp-disable-on-gv-edit.php

<?php
/**
 * Gravity Perks // Conditional Pricing // Disable Conditional Pricing on GravityView Edit
 * https://gravitywiz.com/documentation/gravity-forms-conditional-pricing/
 */
add_action( 'gform_register_init_scripts', function( $form ) {
	if ( is_callable( 'gravityview_get_context' ) && gravityview_get_context() === 'edit' ) {
		unset( GFFormDisplay::$init_scripts[ $form['id'] ]['gwconditionalpricing_1'] );
	}
	return $form;
}, 11 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.