• Resolved Generosus

    (@generosus)


    Good Day,

    How can I stop your plugin from translating the admin toolbar links (backend and frontend)? Specifically, these links.

    A code snippet for the above would be nice.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    Please check: How to skip translations?

    You can possibly add the notranslate class using js.

    Thanks! ??

    Thread Starter Generosus

    (@generosus)

    Solution:

    Following my request, I developed a code snippet (provided below) that gets the job done.

    Since your plugin does not natively translate the backend admin toolbar links, the code snippet provided below only applies to the frontend admin toolbar links.

    It would be great if you can add the code snippet (and all others you’ve developed or those that have been posted by your plugin users) to your plugin’s documentation. Long term, the community wil benefit and the number of repeat support topics will be reduced.

    Cheers!

    —————–

    Code Snippet: (Disable Translation of WP Admin Toolbar Quicklinks – Frontend Only)

    Note: Run the code snippet only on the frontend.

    function disable_translation_admin_toolbar_quicklinks() {
    if ( is_admin_bar_showing() ) {
    ?>
    <script>
    jQuery('div.quicklinks').addClass('notranslate');
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'disable_translation_admin_toolbar_quicklinks');
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.