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

Init() attempts to call a non-static function #1

Open
rtpHarry opened this issue Nov 29, 2023 · 0 comments
Open

Init() attempts to call a non-static function #1

rtpHarry opened this issue Nov 29, 2023 · 0 comments

Comments

@rtpHarry
Copy link

I used your code to initialise my plugin (thanks) and noticed that I got errors for this:

https://github.com/NickGreen/automatewoo-order-add-product/blob/main/class-automatewoo-order-add-free-product.php

The error was:

2023/11/29 04:24:03 [error] 124990#124990: *1562611 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method RunThings_AutomateWoo_WooCommerce_Store_Credit::register_action() cannot be called statically in /www/knepp_839/public/wp-includes/class-wp-hook.php:324

I had to make the register_action static as well.

Maybe it was one of those silent errors, or has become fatal with a newer version of PHP, anyway, I thought I would give you a heads up in case you have this running on any of your sites.

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

1 participant