• Resolved perryrylance

    (@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 AAM_Service_Content::beforeDispatch

    AAM_Service_Content::beforeDispatch will then try to access $attrs['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 Content.php:258 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

    if(is_callable($attrs['callback']))
    	$callback = $attrs['callback'];
    else
    	$callback = (!empty($attrs['callback'][0]) ? $attrs['callback'][0] : null);

    Please let us know what you think.

    Kind regards
    – Perry

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘AAM_Service_Content::beforeDispatch fatal error’ is closed to new replies.