Skip to content

Instantly share code, notes, and snippets.

@ahsannayem
Created April 23, 2025 11:18
Show Gist options
  • Save ahsannayem/8863ee559fdaf9d4334dd680adadaabf to your computer and use it in GitHub Desktop.
Save ahsannayem/8863ee559fdaf9d4334dd680adadaabf to your computer and use it in GitHub Desktop.
Add Menu Item For Fluent Support
add_action('admin_footer', function () {
$screen = get_current_screen();
if (!$screen || strpos($screen->id, 'fluent-support') === false) {
return;
}
?>
<script>
document.addEventListener('DOMContentLoaded', function () {
const checkExist = setInterval(function () {
const menu = document.querySelector('.fframe_menu');
if (menu) {
clearInterval(checkExist);
const newItem = document.createElement('li');
newItem.className = 'fframe_menu_item fframe_item_google';
newItem.setAttribute('data-key', 'google');
newItem.innerHTML = `<a class="fframe_menu_primary" href="https://www.google.com" target="_blank">Google</a>`;
menu.appendChild(newItem);
}
}, 500);
});
</script>
<?php
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment