[wp-hackers] Use-case for sunrise.php?
wp at andrewnacin.com
Sat Dec 11 02:02:44 UTC 2010
On Fri, Dec 10, 2010 at 5:42 PM, Otto <otto at ottodestruct.com> wrote:
> On Fri, Dec 10, 2010 at 4:25 PM, Mike Schinkel
> <mikeschinkel at newclarity.net> wrote:
> > Quick question: What's the use-case that sunrise.php was added to
> resolve? Googling is letting me down here...
> The domain mapping plugin uses it. The sunrise there determines what
> url you're trying to get then switches you to the correct blog.
Check out wp-includes/ms-settings.php. Sunrise gets included early. If
$current_site and $current_blog are set by sunrise, then nearly all of the
logic in that file gets skipped.
In there, you'll find a lot of logic to determine exactly which network and
blog you're trying to reach. The purpose of sunrise is to optionally
override all of that. Domain mapping is one such use case, for sure.
More information about the wp-hackers