• Resolved mattvlc

    (@mattvlc)


    Can the Fluent Snippet team please add an option for this? There is no need for this to be on the top level menu, and it should be under tools, or at least have an option to move the settings page to where it should belong instead of cluttering the WP Admin Panel.

Viewing 1 replies (of 1 total)
  • Thread Starter mattvlc

    (@mattvlc)

    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
    );
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.