D
D
Dmitry Dmitriev2018-02-17 16:57:54
WordPress
Dmitry Dmitriev, 2018-02-17 16:57:54

How to fix PHP Notice: Undefined property in Loco plugin for WordPress?

Friends, tell me how to fix the PHP Notice: Undefined property error in the Loco translator plugin for WordPress?

[13-Feb-2018 19:53:00 UTC] PHP Notice:  Undefined property: Loco_hooks_AdminHooks::$router in /home/www/wp-content/plugins/loco-translate/src/hooks/AdminHooks.php on line 59

**
     * "admin_menu" callback.
     */
    public function on_admin_menu(){
        // This earliest we need translations, and admin user locale should be set by now
        if( $this->router ){    << 59 строка
            $domainPath = dirname( loco_plugin_self() ).'/languages';
            load_plugin_textdomain( 'loco-translate', false, $domainPath );
        }
        // Unhook failure notice that would fire if this hook was not successful
        remove_action( 'admin_notices', array(__CLASS__,'print_hook_failure') );
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-02-17
@webinar

for example, you can also set it
to check for existence,
or if you are a very strange person, and apparently just such a plugin developer, you can turn off notice level errors in php.ini.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question