Make WordPress Core

Ticket #31702: 31702-opt-1.diff

File 31702-opt-1.diff, 817 bytes (added by rmccue, 10 years ago)

Option 1: Add lookup hook

  • wp-includes/ms-settings.php

    diff --git a/wp-includes/ms-settings.php b/wp-includes/ms-settings.php
    index 7b35e76..e5ff0e5 100644
    a b if ( !isset( $current_site ) || !isset( $current_blog ) ) { 
    109109                $current_site = wp_get_network( $current_blog->site_id );
    110110        }
    111111
     112        /**
     113         * Fires after the domain lookup process.
     114         *
     115         * This is a good time to hook in and set a default `$current_site` global
     116         * if one hasn't been determined, or to do any custom lookup handling.
     117         *
     118         * @param string $domain The domain used during the lookup process.
     119         * @param string $path   The path used during the lookup process.
     120         */
     121        do_action( 'ms_site_lookup', $domain, $path );
     122
    112123        // No network has been found, bail.
    113124        if ( empty( $current_site ) ) {
    114125                ms_not_installed();