Skip to content

Instantly share code, notes, and snippets.

@joshuafredrickson
Created June 17, 2024 13:51
Show Gist options
  • Save joshuafredrickson/b45be6185f5a9ecc2df040322eda7c6f to your computer and use it in GitHub Desktop.
Save joshuafredrickson/b45be6185f5a9ecc2df040322eda7c6f to your computer and use it in GitHub Desktop.
Temporary fix for Gravity Forms merge tags on form notification edit screens
<?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