[wp-trac] [WordPress Trac] #42073: Add limit 1 to get_blog_id_from_url

WordPress Trac noreply at wordpress.org
Tue Oct 3 15:39:19 UTC 2017


#42073: Add limit 1 to get_blog_id_from_url
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Networks and Sites                   |  Review
 Severity:  normal                               |     Version:  4.6
 Keywords:  needs-unit-tests has-patch good-     |  Resolution:
  first-bug                                      |     Focuses:  multisite
-------------------------------------------------+-------------------------

Comment (by flixos90):

 We should consider simplifying the function further, by internally using
 the new `get_site_by()`. See
 https://core.trac.wordpress.org/ticket/40180#comment:24

 * The advantage would be less code to maintain, and we could theoretically
 even deprecate this function at some point (not a necessity though).
 * The disadvantage would be that `get_site_by()` returns a full object,
 while we only need an ID here. Not sure that's a real issue though, since
 it only queries for one result anyway, so it shouldn't have a significant
 impact on performance.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42073#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list