Created
June 17, 2024 13:51
-
-
Save joshuafredrickson/b45be6185f5a9ecc2df040322eda7c6f to your computer and use it in GitHub Desktop.
Temporary fix for Gravity Forms merge tags on form notification edit screens
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 | |
/** | |
* Temporary fix for Gravity Forms merge tags on form notification edit screens | |
* | |
* @see https://github.com/roots/acorn/issues/198 | |
*/ | |
add_action('admin_footer', function (): void { | |
// Only on GF admin pages | |
if (!class_exists('GFForms') || !isset($_GET['page']) || 'gf_edit_forms' !== $_GET['page']) { | |
return; | |
} | |
?> | |
<script> | |
const gfFixEl = document.querySelector('select[name="_gform_setting_event"]'); | |
if (gfFixEl) { | |
gfFixEl.setAttribute('id', 'event'); | |
console.log('Gravity Forms merge tags fix applied via `mu-plugins/gravity-forms.php`') | |
} | |
</script> | |
<?php | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment