if ( !is_multisite() ) {
wp_redirect( site_url( '/wp-login.php?action=register' ) );//将用户重定向到一个预先制定的绝对URI
die(); }
$wp_query->is_404 = false; //$wp_query 是在wp-blog-header.php文件中定义的一个WP_Query实体对象,它提供了当前请求的信息。->这个符号访问类实例的属性、方法;
// is_multisite()函数源码,是wordpress自己定义的一个函数
function is_multisite() {
if ( defined( 'MULTISITE' ) )
return MULTISITE; if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) )
return true; return false;
} //函数源码: function wp_redirect($location, $status = 302) {
	global $is_IIS;

	/**
* Filter the redirect location.
*
* @since 2.1.0
*
* @param string $location The path to redirect to.
* @param int $status Status code to use.
*/
$location = apply_filters( 'wp_redirect', $location, $status ); /**
* Filter the redirect status code.
*
* @since 2.3.0
*
* @param int $status Status code to use.
* @param string $location The path to redirect to.
*/
$status = apply_filters( 'wp_redirect_status', $status, $location ); if ( ! $location )
return false; $location = wp_sanitize_redirect($location); if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' )
status_header($status); // This causes problems on IIS and some FastCGI setups header("Location: $location", true, $status); return true;
}

  

  

[/wp_active.php]的更多相关文章

随机推荐

  1. Java使用泛型的困顿

    原文有点儿胡说的意味,删了,有空再次更新这篇博文~

  2. 解决Git无法同步空文件夹的问题

    思路:在每个空文件夹下创建空文件,同步后再删除 package org.zln.module1.demo1; import org.apache.log4j.Logger; import java.i ...

  3. jsp电子商务 购物车实现之一 设计篇

    购物车的功能实现. 查询的资料,找到三种方法: 1.用cookie实现购物车: 2.用session实现购物车: 3.用cookie和数据库(购物车信息持久化)实现购物车: ============= ...

  4. POJ2240:Arbitrage(最长路+正环)

    Arbitrage Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 29374   Accepted: 12279 题目链接: ...

  5. fresco的使用教程

    1.加载依赖 api 'org.xutils:xutils:3.5.0' 2.创建一个myapplication public class MyApplication extends Applicat ...

  6. android studio的弹出层

    <activity android:name=".SecondActivity" android:theme="@style/Theme.AppCompat.Dia ...

  7. hdu 1520Anniversary party 树形dp入门

    There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The Un ...

  8. URAL - 1486 Equal Squares 二维哈希+二分

    During a discussion of problems at the Petrozavodsk Training Camp, Vova and Sasha argued about who o ...

  9. mysql————表类型(存储引擎)的选择

    表类型(存储引擎)的选择 7.1 mysql存储引擎概述 插件式存储引擎是mysql数据库最重要的特性之一,用户可以根据应用的需要选择ruhr存储和索引数据,是否使用事务等. InnoDB和BDB提供 ...

  10. c++虚析构函数的必要性

    我们知道,用C++开发的时候,用来做基类的类的析构函数一般都是虚函数. 可是,为什么要这样做呢?下面用一个小例子来说明: #include<iostream> using namespac ...