PageRenderTime 25ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-includes/default-constants.php

https://gitlab.com/endomorphosis/reservationtelco
PHP | 297 lines | 101 code | 42 blank | 154 comment | 39 complexity | bf3ce112a128d6b9053640f64333b033 MD5 | raw file
  1. <?php
  2. /**
  3. * Defines constants and global variables that can be overridden, generally in wp-config.php.
  4. *
  5. * @package WordPress
  6. */
  7. /**
  8. * Defines initial WordPress constants
  9. *
  10. * @see wp_debug_mode()
  11. *
  12. * @since 3.0.0
  13. */
  14. function wp_initial_constants( ) {
  15. global $blog_id;
  16. // set memory limits
  17. if ( !defined('WP_MEMORY_LIMIT') ) {
  18. if( is_multisite() ) {
  19. define('WP_MEMORY_LIMIT', '64M');
  20. } else {
  21. define('WP_MEMORY_LIMIT', '32M');
  22. }
  23. }
  24. /**
  25. * The $blog_id global, which you can change in the config allows you to create a simple
  26. * multiple blog installation using just one WordPress and changing $blog_id around.
  27. *
  28. * @global int $blog_id
  29. * @since 2.0.0
  30. */
  31. if ( ! isset($blog_id) )
  32. $blog_id = 1;
  33. // set memory limits.
  34. if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) )
  35. @ini_set('memory_limit', WP_MEMORY_LIMIT);
  36. if ( !defined('WP_CONTENT_DIR') )
  37. define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down
  38. // Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development.
  39. if ( !defined('WP_DEBUG') )
  40. define( 'WP_DEBUG', false );
  41. // Add define('WP_DEBUG_DISPLAY', false); to wp-config.php use the globally configured setting for display_errors and not force errors to be displayed.
  42. if ( !defined('WP_DEBUG_DISPLAY') )
  43. define( 'WP_DEBUG_DISPLAY', true );
  44. // Add define('WP_DEBUG_LOG', true); to enable error logging to wp-content/debug.log.
  45. if ( !defined('WP_DEBUG_LOG') )
  46. define('WP_DEBUG_LOG', false);
  47. if ( !defined('WP_CACHE') )
  48. define('WP_CACHE', false);
  49. /**
  50. * Private
  51. */
  52. if ( !defined('MEDIA_TRASH') )
  53. define('MEDIA_TRASH', false);
  54. if ( !defined('SHORTINIT') )
  55. define('SHORTINIT', false);
  56. }
  57. /**
  58. * Defines plugin directory WordPress constants
  59. *
  60. * Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in
  61. *
  62. * @since 3.0.0
  63. */
  64. function wp_plugin_directory_constants( ) {
  65. if ( !defined('WP_CONTENT_URL') )
  66. define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
  67. /**
  68. * Allows for the plugins directory to be moved from the default location.
  69. *
  70. * @since 2.6.0
  71. */
  72. if ( !defined('WP_PLUGIN_DIR') )
  73. define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
  74. /**
  75. * Allows for the plugins directory to be moved from the default location.
  76. *
  77. * @since 2.6.0
  78. */
  79. if ( !defined('WP_PLUGIN_URL') )
  80. define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash
  81. /**
  82. * Allows for the plugins directory to be moved from the default location.
  83. *
  84. * @since 2.1.0
  85. * @deprecated
  86. */
  87. if ( !defined('PLUGINDIR') )
  88. define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
  89. /**
  90. * Allows for the mu-plugins directory to be moved from the default location.
  91. *
  92. * @since 2.8.0
  93. */
  94. if ( !defined('WPMU_PLUGIN_DIR') )
  95. define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash
  96. /**
  97. * Allows for the mu-plugins directory to be moved from the default location.
  98. *
  99. * @since 2.8.0
  100. */
  101. if ( !defined('WPMU_PLUGIN_URL') )
  102. define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash
  103. /**
  104. * Allows for the mu-plugins directory to be moved from the default location.
  105. *
  106. * @since 2.8.0
  107. * @deprecated
  108. */
  109. if ( !defined( 'MUPLUGINDIR' ) )
  110. define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.
  111. }
  112. /**
  113. * Defines cookie related WordPress constants
  114. *
  115. * Defines constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
  116. * @since 3.0.0
  117. */
  118. function wp_cookie_constants( ) {
  119. global $wp_default_secret_key;
  120. /**
  121. * Used to guarantee unique hash cookies
  122. * @since 1.5
  123. */
  124. if ( !defined( 'COOKIEHASH' ) ) {
  125. $siteurl = get_site_option( 'siteurl' );
  126. if ( $siteurl )
  127. define( 'COOKIEHASH', md5( $siteurl ) );
  128. else
  129. define( 'COOKIEHASH', '' );
  130. }
  131. /**
  132. * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php
  133. * @since 2.5.0
  134. */
  135. $wp_default_secret_key = 'put your unique phrase here';
  136. /**
  137. * @since 2.0.0
  138. */
  139. if ( !defined('USER_COOKIE') )
  140. define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
  141. /**
  142. * @since 2.0.0
  143. */
  144. if ( !defined('PASS_COOKIE') )
  145. define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
  146. /**
  147. * @since 2.5.0
  148. */
  149. if ( !defined('AUTH_COOKIE') )
  150. define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
  151. /**
  152. * @since 2.6.0
  153. */
  154. if ( !defined('SECURE_AUTH_COOKIE') )
  155. define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH);
  156. /**
  157. * @since 2.6.0
  158. */
  159. if ( !defined('LOGGED_IN_COOKIE') )
  160. define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);
  161. /**
  162. * @since 2.3.0
  163. */
  164. if ( !defined('TEST_COOKIE') )
  165. define('TEST_COOKIE', 'wordpress_test_cookie');
  166. /**
  167. * @since 1.2.0
  168. */
  169. if ( !defined('COOKIEPATH') )
  170. define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
  171. /**
  172. * @since 1.5.0
  173. */
  174. if ( !defined('SITECOOKIEPATH') )
  175. define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
  176. /**
  177. * @since 2.6.0
  178. */
  179. if ( !defined('ADMIN_COOKIE_PATH') )
  180. define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
  181. /**
  182. * @since 2.6.0
  183. */
  184. if ( !defined('PLUGINS_COOKIE_PATH') )
  185. define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) );
  186. /**
  187. * @since 2.0.0
  188. */
  189. if ( !defined('COOKIE_DOMAIN') )
  190. define('COOKIE_DOMAIN', false);
  191. }
  192. /**
  193. * Defines cookie related WordPress constants
  194. *
  195. * @since 3.0.0
  196. */
  197. function wp_ssl_constants( ) {
  198. /**
  199. * @since 2.6.0
  200. */
  201. if ( !defined('FORCE_SSL_ADMIN') )
  202. define('FORCE_SSL_ADMIN', false);
  203. force_ssl_admin(FORCE_SSL_ADMIN);
  204. /**
  205. * @since 2.6.0
  206. */
  207. if ( !defined('FORCE_SSL_LOGIN') )
  208. define('FORCE_SSL_LOGIN', false);
  209. force_ssl_login(FORCE_SSL_LOGIN);
  210. }
  211. /**
  212. * Defines functionality related WordPress constants
  213. *
  214. * @since 3.0.0
  215. */
  216. function wp_functionality_constants( ) {
  217. /**
  218. * @since 2.5.0
  219. */
  220. if ( !defined( 'AUTOSAVE_INTERVAL' ) )
  221. define( 'AUTOSAVE_INTERVAL', 60 );
  222. /**
  223. * @since 2.9.0
  224. */
  225. if ( !defined( 'EMPTY_TRASH_DAYS' ) )
  226. define( 'EMPTY_TRASH_DAYS', 30 );
  227. if ( !defined('WP_POST_REVISIONS') )
  228. define('WP_POST_REVISIONS', true);
  229. }
  230. /**
  231. * Defines templating related WordPress constants
  232. *
  233. * @since 3.0.0
  234. */
  235. function wp_templating_constants( ) {
  236. /**
  237. * Web Path to the current active template directory
  238. * @since 1.5.0
  239. */
  240. define('TEMPLATEPATH', get_template_directory());
  241. /**
  242. * Web Path to the current active template stylesheet directory
  243. * @since 2.1.0
  244. */
  245. define('STYLESHEETPATH', get_stylesheet_directory());
  246. /**
  247. * Slug of the default theme for this install.
  248. * Used as the default theme when installing new sites.
  249. * Will be used as the fallback if the current theme doesn't exist.
  250. * @since 3.0.0
  251. */
  252. if ( !defined('WP_DEFAULT_THEME') )
  253. define( 'WP_DEFAULT_THEME', 'twentyten' );
  254. }
  255. ?>