I came up with a solution via ChatGPT, just add this if you want. Other people– here is a solution. Just run this with the plugin in standalone mode if you like.
// Hook into the admin_menu action with a high priority to ensure it runs after Fluent Snippets adds its menu
add_action('admin_menu', 'move_fluent_snippets_menu', 999);
/**
* Moves Fluent Snippets menu under Tools submenu if the plugin is active.
*/
function move_fluent_snippets_menu() {
// Check if the Fluent Snippets plugin is active by verifying the existence of a key class
if (!class_exists('FluentSnippets\App\Hooks\Handlers\AdminMenuHandler')) {
return; // Exit if the Fluent Snippets plugin is not active
}
// Define the Fluent Snippets menu slug
$fluent_snippets_slug = 'fluent-snippets';
// Remove the top-level Fluent Snippets menu
remove_menu_page($fluent_snippets_slug);
// Add Fluent Snippets as a submenu under Tools
add_submenu_page(
'tools.php', // Parent slug (Tools menu)
__('Fluent Snippets', 'easy-code-manager'), // Page title
__('Fluent Snippets', 'easy-code-manager'), // Menu title
'install_plugins', // Capability (matches the original)
$fluent_snippets_slug // Menu slug (same as original)
// No callback needed as the plugin already handles it
);
}