wp-rest-polylang icon indicating copy to clipboard operation
wp-rest-polylang copied to clipboard

Fatal error: Uncaught Error: Using $this when not in object context

Open zamson opened this issue 5 years ago • 1 comments

I'm getting this error on one of my sites and I'm not sure how to solve it.

Fatal error: Uncaught Error: Using $this when not in object context in /example.com/web/app/mu-plugins/wp-rest-polylang.php:58 Stack trace: #0 /example.com/web/app/mu-plugins/wp-rest-polylang.php(48): WP_REST_polylang::register_api_field() #1 /example.com/web/wp/wp-includes/class-wp-hook.php(288): WP_REST_polylang::init() #2 /example.com/web/wp/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters() #3 /example.com/web/wp/wp-includes/plugin.php(478): WP_Hook->do_action() #4 /example.com/web/wp/wp-includes/rest-api.php(471): do_action() #5 /example.com/web/wp/wp-includes/rest-api.php(298): rest_get_server() #6 /example.com/web/wp/wp-includes/class-wp-hook.php(288): rest_api_loaded() #7 /example.com/web/wp/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters() #8 /example.com/web/wp/wp-includes/plugin.php(544): WP_Hook->do_action() #9 /example.com/web/wp/wp-includes/class-wp.php(387): do_action in /example.com/web/app/mu-plugins/wp-rest-polylang.php on line 58

zamson avatar Mar 27 '20 08:03 zamson

just remove static from init function

- public static function init()
+ public function init()

omarkhatibco avatar Jul 07 '20 10:07 omarkhatibco