Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

settings.php uses $this in static method #21

Open
jasonmobley opened this issue Feb 1, 2020 · 0 comments
Open

settings.php uses $this in static method #21

jasonmobley opened this issue Feb 1, 2020 · 0 comments

Comments

@jasonmobley
Copy link

https://github.com/Ipstenu/dreamobjects/blob/master/lib/settings.php#L148

My Wordpress site suddenly started encoutering the following issue because of line 148 using $this in a static method:

Error Details
=============
An error of type E_ERROR was caused in line 148 of the file /home/.../wp-content/plugins/dreamobjects/lib/settings.php. Error message: Uncaught Error: Using $this when not in object context in /home/.../wp-content/plugins/dreamobjects/lib/settings.php:148
Stack trace:
#0 /home/.../wp-includes/class-wp-hook.php(288): DreamObjects_Settings::add_settings_page('')
#1 /home/.../wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array)
#2 /home/.../wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#3 /home/.../wp-admin/includes/menu.php(155): do_action('admin_menu', '')
#4 /home/.../wp-admin/menu.php(326): require_once('/home/...')
#5 /home/.../wp-admin/admin.php(153): require('/home/...')
#6 /home/.../wp-admin/plugins.php(10): require_once('/home/...')
#7 {main}
  thrown

I had to use the admin recovery mode to disable the plugin. I'm not sure how it worked fine prior to today. The only thing I messed with around the time it started happening was toggling between PHP 7.2 and 7.4 on my web server.

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

No branches or pull requests

1 participant