ms_cookie_constants()
ms_cookie_constants() 定义多站点cookie常量。Defines Multisite c…
ms_cookie_constants()
定义多站点cookie常量。
Defines Multisite cookie constants.
目录锚点:#返回#源码
返回(Return)
无返回值
源码(Source)
/**
* Defines Multisite cookie constants.
*
* @since 3.0.0
*/
function ms_cookie_constants( ) {
$current_site = get_current_site();
/**
* @since 1.2.0
*/
if ( !defined( 'COOKIEPATH' ) )
define( 'COOKIEPATH', $current_site->path );
/**
* @since 1.5.0
*/
if ( !defined( 'SITECOOKIEPATH' ) )
define( 'SITECOOKIEPATH', $current_site->path );
/**
* @since 2.6.0
*/
if ( !defined( 'ADMIN_COOKIE_PATH' ) ) {
if ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) {
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
} else {
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
}
}
/**
* @since 2.0.0
*/
if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) {
if ( !empty( $current_site->cookie_domain ) )
define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain);
else
define('COOKIE_DOMAIN', '.' . $current_site->domain);
}
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.0.0 | wp-includes/ms-default-constants.php:50 | 0 | 3 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。




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