Created
January 17, 2020 22:32
-
-
Save spivurno/47c700543e04b32229ca1b3d14d4ae4b to your computer and use it in GitHub Desktop.
Modified WC_GFPA_Cart::enable_gform_after_submission_hooks() method.
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
private function disable_gform_after_submission_hooks( $form_id ) { | |
global $wp_filter, $wp_actions; | |
$tag = 'gform_after_submission'; | |
if ( ! isset( $this->_wp_filters[ $tag ] ) ) { | |
if ( isset( $wp_filter[ $tag ] ) ) { | |
$this->_wp_filters[ $tag ] = $wp_filter[ $tag ]; | |
unset( $wp_filter[ $tag ] ); | |
} | |
} | |
$tag = "gform_after_submission_{$form_id}"; | |
if ( ! isset( $this->_wp_filters[ $tag ] ) ) { | |
if ( isset( $wp_filter[ $tag ] ) ) { | |
$this->_wp_filters[ $tag ] = $wp_filter[ $tag ]; | |
unset( $wp_filter[ $tag ] ); | |
} | |
} | |
$tag = 'gform_entry_post_save'; | |
if ( ! isset( $this->_wp_filters[ $tag ] ) ) { | |
if ( isset( $wp_filter[ $tag ] ) ) { | |
$this->_wp_filters[ $tag ] = $wp_filter[ $tag ]; | |
unset( $wp_filter[ $tag ] ); | |
} | |
} | |
$tag = "gform_entry_post_save_{$form_id}"; | |
if ( ! isset( $this->_wp_filters[ $tag ] ) ) { | |
if ( isset( $wp_filter[ $tag ] ) ) { | |
$this->_wp_filters[ $tag ] = $wp_filter[ $tag ]; | |
unset( $wp_filter[ $tag ] ); | |
} | |
} | |
} | |
private function enable_gform_after_submission_hooks( $form_id ) { | |
global $wp_filter; | |
$tag = 'gform_after_submission'; | |
if ( isset( $this->_wp_filters[ $tag ] ) ) { | |
$wp_filter[ $tag ] = $this->_wp_filters[ $tag ]; | |
} | |
$tag = "gform_after_submission_{$form_id}"; | |
if ( isset( $this->_wp_filters[ $tag ] ) ) { | |
$wp_filter[ $tag ] = $this->_wp_filters[ $tag ]; | |
} | |
$tag = 'gform_entry_post_save'; | |
if ( isset( $this->_wp_filters[ $tag ] ) ) { | |
$wp_filter[ $tag ] = $this->_wp_filters[ $tag ]; | |
} | |
$tag = "gform_entry_post_save_{$form_id}"; | |
if ( isset( $this->_wp_filters[ $tag ] ) ) { | |
$wp_filter[ $tag ] = $this->_wp_filters[ $tag ]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment