Title: REST API Bug
Last modified: May 22, 2018

---

# REST API Bug

 *  [SebeT](https://wordpress.org/support/users/sebet/)
 * (@sebet)
 * [8 years ago](https://wordpress.org/support/topic/rest-api-bug/)
 * While doing some theme development with Disqus installed I’ve noticed that calling‘
   get_rest_url()’ with a blog ID was always returning the main site URL (i.e: get_rest_url(
   2 ) ).
 * After some debugging I’ve traced the issue to this filter:
    `$this->loader->add_filter('
   rest_url', $plugin_admin, 'dsq_filter_rest_url' );`
 * The callback is ALWAYS overriding the input URL causing issues whenever I want
   to return a REST API URL from a sub-site.
 * Please add some logic so that the URL is only overriden when your endpoints are
   being used, otherwise this can break site functionality.
 * I had to disable the filter to be able to get the correct sub-site REST API URL.
 * Thanks!

The topic ‘REST API Bug’ is closed to new replies.

 * ![](https://ps.w.org/disqus-comment-system/assets/icon.svg?rev=1636350)
 * [Disqus Comment System](https://wordpress.org/plugins/disqus-comment-system/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disqus-comment-system/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disqus-comment-system/)
 * [Active Topics](https://wordpress.org/support/plugin/disqus-comment-system/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disqus-comment-system/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disqus-comment-system/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [SebeT](https://wordpress.org/support/users/sebet/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/rest-api-bug/)
 * Status: not resolved