WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #40228, comment 8


Ignore:
Timestamp:
03/24/2017 12:10:41 AM (2 years ago)
Author:
flixos90
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40228, comment 8

    initial v1  
    11[attachment:40228.diff] shows a possible implementation of `get_blog_details()` using `get_site_by()` (see #40180). Since the patch relies on that function, it is required that you apply the patch on #40180 as well in order to test.
    22
    3 All regular `get_blog_details()` tests pass after the change, however I had to adjust / partly remove some tests related to the `blog-details` and `blog-lookup` caches, since these now don't exist any longer. There are two tests related to the `site-details` cache, however that is due to a bug in setting that cache, for which I'll open a ticket shortly.
     3All regular `get_blog_details()` tests pass after the change, however I had to adjust / partly remove some tests related to the `blog-details` and `blog-lookup` caches, since these now don't exist any longer. There are two tests failing related to the `site-details` cache, however that is due to a bug in setting that cache, for which I'll open a ticket shortly.
    44
    55The code in `get_blog_details()` has obviously been drastically reduced, and by using `get_site_by()` the patch fulfills the original requirement of using the more efficient `get_sites()` / `get_site()` functions. Admittedly there is one ''really weird'' line in the new code (`$site->detail = $site->detail;`), but it actually does what it is supposed to do (PHP magic method weirdness) - however this code is one of the reasons that I think we should recommend using `get_site_by()` over `get_blog_details()` going forward (see more below).