0

I am not the Plugin or theme developer, but after updating the Better AMP , I discovered the following error log. What could be the reason? Is there any manual solution to this?

[24-Apr-2017 19:15:08 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Better_AMP' does not have a method '_return_false' in /wp-includes/class-wp-hook.php on line 298

  • Submit to the publisher and rollback your version to the previous error-free version. – jdm2112 Apr 24 '17 at 19:28
3

This is a problem with the Better AMP plugin. Best to do is report it to the plugin developer.

There is an invalid filter hook in the plugin, for a quick fix you can try to modify the file wp-content/plugins/better-amp/better-amp.php.

Change line 1197 and 1198:

// From:
    add_filter( '...', array( $this, '_return_false' ) );

// To:
    add_filter( '...', '__return_false' );
| improve this answer | |
  • Surely I will inform the developer. Well, on updating the better-amp.php I am now getting following errors PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '_return_false' not found or invalid function name in wp-includes/class-wp-hook.php on line 298 – Disk01 Apr 24 '17 at 19:57
  • 1
    There should be two underscores. __return_false – Nathan Johnson Apr 24 '17 at 19:58
  • Awesome! It really worked. Thank you philipp and nathan – Disk01 Apr 24 '17 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.