cameronterry / dark-matter

A highly opinionated domain mapping plugin for WordPress Networks
Other
12 stars 2 forks source link

$current_blog should return a WP_Site object #17

Closed cameronterry closed 5 years ago

cameronterry commented 7 years ago

As of WordPress 4.5 the global variable $current_blog has been set to an instance of WP_Site object rather than just an stdClass. In truth though, it should return a WP_Site object if the version of WordPress is 4.5 or above rather than rely on WordPress Core's backward compatibility / checks.

It may require reworking the way things like HTTPS is detected as this is currently a property of the $current_blog object. This likely have to move into the return of WP_Site->get_details() through the blog_details or site_details filter.

In fact ... we will need to make a decision on whether this change detects WordPress 4.5 or 4.6 before implementing it, as some actions have been moving around as part of the work to change from "blog" to "site" as a naming convention.

This is likely an oversight from using Donncha's Domain Mapping plugin as a bit of a loose template for Dark Matter.