Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zamson opened this issue Mar 27, 2020 · 1 comment
Open

Comments

@zamson
Copy link

zamson commented Mar 27, 2020

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

@omarkhatibco
Copy link

just remove static from init function

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants