WordPress.org

Ready to get started?Download WordPress

Forums

Google Language Translator
[resolved] Fatal Error when activating GLT (5 posts)

  1. eaglebane
    Member
    Posted 4 months ago #

    Greetings,

    Whenever I try to activate the plugin, I get the follow error:

    Fatal error: Cannot redeclare scripts() (previously declared in /home/content/44/11172244/html/mysite/wp-content/themes/promotion/functions.php:29) in /home/content/44/11172244/html/mysite/wp-content/plugins/google-language-translator/glt_scripts.php on line 15

    When I go to those items it seems that is a jquery call.

    https://wordpress.org/plugins/google-language-translator/

  2. Rob Myrick
    Member
    Plugin Author

    Posted 4 months ago #

    Hi eaglebane, I think there is another function in your WordPress theme named scripts().

    Let's try this:

    Locate the file glt_scripts.php in the plugin, then locate line 3, it should look like this:

    function scripts($hook_suffix) {

    Change it to another name, such as function glt_scripts($hook_suffix) {

    Then on line 34 there is this code:

    add_action( 'admin_enqueue_scripts', 'scripts');

    Change it to this:

    add_action( 'admin_enqueue_scripts', 'glt_scripts');

    That's it! Let me know if it works!

  3. eaglebane
    Member
    Posted 4 months ago #

    Well now everything is off...you can check it out at grayroadchurchofchrist.org

  4. eaglebane
    Member
    Posted 4 months ago #

    I fixed it! You are the man! Thanks!

  5. Rob Myrick
    Member
    Plugin Author

    Posted 4 months ago #

    Thanks for updating us here. Enjoy!

Reply

You must log in to post.

About this Plugin

About this Topic