wp-rest-polylang
wp-rest-polylang copied to clipboard
Fatal error: Uncaught Error: Using $this when not in object context
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
just remove static from init function
- public static function init()
+ public function init()