ms_cookie_constants

Defines Multisite cookie constants.

Description

ms_cookie_constants(); 

Usage

  1. if ( !function_exists( 'ms_cookie_constants' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-default-constants.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ms_cookie_constants(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-default-constants.php  
  1. function ms_cookie_constants( ) { 
  2. $current_network = get_network(); 
  3.  
  4. /** 
  5. * @since 1.2.0 
  6. */ 
  7. if ( !defined( 'COOKIEPATH' ) ) 
  8. define( 'COOKIEPATH', $current_network->path ); 
  9.  
  10. /** 
  11. * @since 1.5.0 
  12. */ 
  13. if ( !defined( 'SITECOOKIEPATH' ) ) 
  14. define( 'SITECOOKIEPATH', $current_network->path ); 
  15.  
  16. /** 
  17. * @since 2.6.0 
  18. */ 
  19. if ( !defined( 'ADMIN_COOKIE_PATH' ) ) { 
  20. if ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) { 
  21. } else { 
  22. define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); 
  23.  
  24. /** 
  25. * @since 2.0.0 
  26. */ 
  27. if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) { 
  28. if ( !empty( $current_network->cookie_domain ) ) 
  29. define('COOKIE_DOMAIN', '.' . $current_network->cookie_domain); 
  30. else 
  31. define('COOKIE_DOMAIN', '.' . $current_network->domain);