Support

Account

Home Forums ACF PRO Options page in REST API Reply To: Options page in REST API

  • Here’s what I did to get this working.

    add_action("rest_api_init", function () {
      register_rest_route("options", "/all", [
        "methods" => "GET",
        "callback" => "acf_options_route",
      ]);
    }
    function acf_options_route() {
      return get_fields('options');
    }

    Now the custom endpoint {{site}}/wp-json/options/all will return all the site options.