lucrus73 / whaddaprice

Pricing table WP plugin
GNU General Public License v3.0
0 stars 2 forks source link

PHP error #1

Open lucrus73 opened 5 years ago

lucrus73 commented 5 years ago

In the current version I get:

PHP Deprecated: Non-static method Whaddaprice_Admin::waddaprice_custom_post_type() should not be called statically in /wp-includes/class-wp-hook.php on line 286 PHP Stack trace:

  1. {main}() /wp-admin/admin-ajax.php:0
  2. require_once() /wp-admin/admin-ajax.php:22
  3. require_once() /wp-load.php:37
  4. require_once() /wp-config.php:89
  5. do_action() /wp-settings.php:525
  6. WP_Hook->do_action() /wp-includes/plugin.php:465
  7. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310'
DanyeleL commented 5 years ago

hi Lucrus 73, I created a new class and moved everything inside, I also made improvements to the column removal. I've committed

lucrus73 commented 5 years ago

Unfortunately that did not fix the bug.

DanyeleL commented 5 years ago

hi I discovered the problem, the functions waddaprice_custom_post_type () and custom_waddaprice_column () must be declared static or outside the class, if you don't have urgency for now don't commit with these changes

lucrus73 commented 5 years ago

I think the problem is more likely here: you should call add_action in a function inside the Whaddaprice_panel class and use $this as first element of the callback array, instead of the class name.

DanyeleL commented 5 years ago

If I do as I said the problema goes away.