Make WordPress Core

Ticket #37053: 37053.diff

File 37053.diff, 1.9 KB (added by flixos90, 9 years ago)
  • src/wp-includes/ms-load.php

     
    161161 * @param string   $domain   Domain to check.
    162162 * @param string   $path     Path to check.
    163163 * @param int|null $segments Path segments to use. Defaults to null, or the full path.
    164  * @return object|false Site object if successful. False when no site is found.
     164 * @return WP_Site|false Site object if successful. False when no site is found.
    165165 */
    166166function get_site_by_path( $domain, $path, $segments = null ) {
    167167        $path_segments = array_filter( explode( '/', trim( $path, '/' ) ) );
     
    204204         *
    205205         * @since 3.9.0
    206206         *
    207          * @param null|bool|object $site     Site value to return by path.
    208          * @param string           $domain   The requested domain.
    209          * @param string           $path     The requested path, in full.
    210          * @param int|null         $segments The suggested number of paths to consult.
    211          *                                   Default null, meaning the entire path was to be consulted.
    212          * @param array            $paths    The paths to search for, based on $path and $segments.
     207         * @param null|bool|WP_Site $site     Site value to return by path.
     208         * @param string            $domain   The requested domain.
     209         * @param string            $path     The requested path, in full.
     210         * @param int|null          $segments The suggested number of paths to consult.
     211         *                                    Default null, meaning the entire path was to be consulted.
     212         * @param array             $paths    The paths to search for, based on $path and $segments.
    213213         */
    214214        $pre = apply_filters( 'pre_get_site_by_path', null, $domain, $path, $segments, $paths );
    215215        if ( null !== $pre ) {
     216                if ( false !== $pre && ! $pre instanceof WP_Site ) {
     217                        $pre = new WP_Site( $pre );
     218                }
    216219                return $pre;
    217220        }
    218221