Support » Plugin: Worthy - VG-Wort Integration für WordPress » Fatal error in wp-worthy.php

  • Resolved perryrylance


    Hi there

    Perry here from WP Google Maps, I hope this finds you well.

    Your plugin binds a filter to rest_request_before_callbacks, which calls wp_worthy::onREST

    wp_worthy::onREST will then try to access $handler['callback'] as an indexed array.

    Our plugin, for various technical reasons, passes a closure as the callback for many REST routes.

    Because of this, your plugin will throw an exception at wp-worthy.php:537 when our plugin is active.

    Could we ask that you make a small change here in order to accommodate plugins that pass closure functions into the REST API?

    Our suggested fix would be

    $this->onRESTQuery =
    	isset ($handler ['callback']) &&
    	!($handler['callback'] instanceof Closure) &&
    	($handler ['callback'][0] instanceof WP_REST_Posts_Controller) &&
    	($handler ['callback'][1] == 'get_item');

    Please let us know what you think.

    Kind regards
    – Perry

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tiggerswelt


    Hi Perry,

    thank you for your post. Of course you are right! Our plugin should properly handle any type of callback at that point correctly, unfortunately it is not (as the whole thing is kind of hacky, but only because there is no proper way to do it right).

    I’ve opened an issue on our tracker for the next bug-fix release. I hope we’ll get it out quickly to solve this issue.

    Kind regards,


    Hi @tiggerswelt

    Thank you for getting back to us!

    We look forward to the release 🙂

    Kind regards
    – Perry

    Plugin Author tiggerswelt


    Should be fixed in 1.5.4

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.