Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

REST API in demo does not work due to late hook #80

@JasonTheAdams

Description

@JasonTheAdams

Greetings!

I'm getting familiar with this and testing things out. Having fun so far!

When I went to use the demo I found that the agent wasn't working because the REST endpoints introduced in the demo weren't being registered. After some inspection, I found that it's because the $proxy_instance->register_hooks() is being called inside of the wp_feature_api_init action callback, which occurs after rest_api_init has already fired.

My solution was to pull it out of the function and call it outside of any function — which makes sense since all it does it hook another function.

Wanted to let y'all know! If someone gives me a sense of how you would like it to work, then I'm happy to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions