init

Set up constants with default values, unless user overrides.

Description

init(); 

Usage

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

Defined (1)

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

/wp-includes/rss.php  
  1. function init () { 
  2. if ( defined('MAGPIE_INITALIZED') ) { 
  3. return; 
  4. else { 
  5. define('MAGPIE_INITALIZED', 1); 
  6.  
  7. if ( !defined('MAGPIE_CACHE_ON') ) { 
  8. define('MAGPIE_CACHE_ON', 1); 
  9.  
  10. if ( !defined('MAGPIE_CACHE_DIR') ) { 
  11. define('MAGPIE_CACHE_DIR', './cache'); 
  12.  
  13. if ( !defined('MAGPIE_CACHE_AGE') ) { 
  14. define('MAGPIE_CACHE_AGE', 60*60); // one hour 
  15.  
  16. if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) { 
  17. define('MAGPIE_CACHE_FRESH_ONLY', 0); 
  18.  
  19. if ( !defined('MAGPIE_DEBUG') ) { 
  20. define('MAGPIE_DEBUG', 0); 
  21.  
  22. if ( !defined('MAGPIE_USER_AGENT') ) { 
  23. $ua = 'WordPress/' . $GLOBALS['wp_version']; 
  24.  
  25. if ( MAGPIE_CACHE_ON ) { 
  26. $ua = $ua . ')'; 
  27. else { 
  28. $ua = $ua . '; No cache)'; 
  29.  
  30. define('MAGPIE_USER_AGENT', $ua); 
  31.  
  32. if ( !defined('MAGPIE_FETCH_TIME_OUT') ) { 
  33. define('MAGPIE_FETCH_TIME_OUT', 2); // 2 second timeout 
  34.  
  35. // use gzip encoding to fetch rss files if supported? 
  36. if ( !defined('MAGPIE_USE_GZIP') ) { 
  37. define('MAGPIE_USE_GZIP', true);