• In rest-api.php, the function rest_output_link_wp_head() calls get_rest_url() to fetch the REST URL. If that function returns empty, it exits.

    So if I wanted to prevent the https://api.w.org/.. header output, I assumed I could use the rest_url filter to handle that.

    But when I do hook that filter, and return an empty string, nothing seems to change. What am I doing wrong?

    (I understand that it’s not a good idea to entirely disable the WordPress REST API.)

    • This topic was modified 3 years, 9 months ago by joho68.
    • This topic was modified 3 years, 9 months ago by joho68.
    • This topic was modified 3 years, 9 months ago by joho68.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I tried returning an empty string from “rest_url” and it suppressed the header link all right. It also breaks the API, so it’s the wrong approach. What are you actually trying to accomplish?

Viewing 1 replies (of 1 total)
  • The topic ‘Returning empty rest_url_prefix creates a crash’ is closed to new replies.