[/wp_active.php]
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]的更多相关文章
随机推荐
- Python执行Linux系统命令的4种方法
http://www.jb51.net/article/56490.htm (1) os.system 仅仅在一个子终端运行系统命令,而不能获取命令执行后的返回信息 复制代码代码如下: system( ...
- java 自定义序列化
pom.xml 导包 创建自己的序列化类,继承 com.fasterxml.jackson.databind.JsonSerializer<T> 抽象类 重写 serialize() 方法 ...
- Dubbo 的 Helloworld
前提条件 安装好了 ZooKeeper 作为注册中心 服务端 <?xml version="1.0" encoding="UTF-8"?> < ...
- [Leetcode] Anagrams 颠倒字母构成词
Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be ...
- 【BZOJ 2753 滑雪与时间胶囊】
Time Limit: 50 Sec Memory Limit: 128 MBSubmit: 2843 Solved: 993[Submit][Status][Discuss] Descripti ...
- bzoj 1878
莫队乱搞的第一题,(感觉这个算法初学的时候就能想到啊) 总之就是离线,然后扫一遍然后回答,用数组记录状态 但还是有一个地方不太明白 为什么要除siz?这样为什么会优化复杂度呢?? bool cmp(c ...
- HDU 5670
Machine Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Sub ...
- fastjson对json操作
fastjson对json字符串JSONObject和JSONArray互相转换操作示例 fastjson的方法: Fastjson API入口类是com.alibaba.fastjson.JSON ...
- iebackground+icon图标兼容
<!DOCTYPE > <html> <head> <title>zepto</title> <meta name="nam ...
- nginx+webpy+uswgi+jwplayer组合搭建流媒体服务器
转载自:http://blog.csdn.net/cjsafty/article/details/7892392 目前,由于Flash的流行,网络上绝大多数的微视频网站都采用了Flv格式来播放视频. ...