maybe_redirect_404()
maybe_redirect_404() 定义noblogdirect时更正404重定向。Correct 40…
maybe_redirect_404()
定义noblogdirect时更正404重定向。
Correct 404 redirects when NOBLOGREDIRECT is defined.
目录锚点:#返回#源码
返回(Return)
无返回值
源码(Source)
/**
* Correct 404 redirects when NOBLOGREDIRECT is defined.
*
* @since MU
*/
function maybe_redirect_404() {
/**
* Filter the redirect URL for 404s on the main site.
*
* The filter is only evaluated if the NOBLOGREDIRECT constant is defined.
*
* @since 3.0.0
*
* @param string $no_blog_redirect The redirect URL defined in NOBLOGREDIRECT.
*/
if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) && ( $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT ) ) ) {
if ( $destination == '%siteurl%' )
$destination = network_home_url();
wp_redirect( $destination );
exit();
}
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| MU (3.0.0) | wp-includes/ms-functions.php:2083 | 0 | 6 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。




还没有任何评论,赶紧来占个楼吧!