WordPress 3.0 beta 1 documentation kindly provided to you by Hay Kranen
| [ Index ] |
PHP Cross Reference of WordPress 3.0 beta 1 |
|
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Used to set up and fix common variables and include 4 * the WordPress procedural and class library. 5 * 6 * Allows for some configuration in wp-config.php (see default-constants.php) 7 * 8 * @package WordPress 9 */ 10 11 /** 12 * Stores the location of the WordPress directory of functions, classes, and core content. 13 * 14 * @since 1.0.0 15 */ 16 define( 'WPINC', 'wp-includes' ); 17 18 // Include files required for initialization. 19 require( ABSPATH . WPINC . '/load.php' ); 20 require( ABSPATH . WPINC . '/default-constants.php' ); 21 require( ABSPATH . WPINC . '/version.php' ); 22 23 // Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. 24 wp_initial_constants( ); 25 26 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. 27 set_magic_quotes_runtime( 0 ); 28 @ini_set( 'magic_quotes_sybase', 0 ); 29 30 // Set default timezone in PHP 5. 31 if ( function_exists( 'date_default_timezone_set' ) ) 32 date_default_timezone_set( 'UTC' ); 33 34 // Turn register_globals off. 35 wp_unregister_GLOBALS(); 36 37 // Ensure these global variables do not exist so they do not interfere with WordPress. 38 unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate ); 39 40 // Standardize $_SERVER variables across setups. 41 wp_fix_server_vars(); 42 43 // Check for the required PHP version and for the MySQL extension or a database drop-in. 44 wp_check_php_mysql_versions(); 45 46 // Check if we have recieved a request due to missing favicon.ico 47 wp_favicon_request(); 48 49 // Check if we're in maintenance mode. 50 wp_maintenance(); 51 52 // Start loading timer. 53 timer_start(); 54 55 // Check if we're in WP_DEBUG mode. 56 wp_debug_mode(); 57 58 // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. 59 if ( WP_CACHE ) 60 @include( WP_CONTENT_DIR . '/advanced-cache.php' ); 61 62 // Define WP_LANG_DIR if not set. 63 wp_set_lang_dir(); 64 65 // Load early WordPress files. 66 require( ABSPATH . WPINC . '/compat.php' ); 67 require( ABSPATH . WPINC . '/functions.php' ); 68 require( ABSPATH . WPINC . '/classes.php' ); 69 70 // Include the wpdb class, or a db.php database drop-in if present. 71 require_wp_db(); 72 73 // Set the database table prefix and the format specifiers for database table columns. 74 wp_set_wpdb_vars(); 75 76 // Start the WordPress object cache, or an external object cache if the drop-in is present. 77 wp_start_object_cache(); 78 79 // Load early WordPress files. 80 require( ABSPATH . WPINC . '/plugin.php' ); 81 require( ABSPATH . WPINC . '/default-filters.php' ); 82 require( ABSPATH . WPINC . '/pomo/mo.php' ); 83 84 // Initialize multisite if enabled. 85 if ( is_multisite() ) { 86 require( ABSPATH . WPINC . '/ms-blogs.php' ); 87 require( ABSPATH . WPINC . '/ms-settings.php' ); 88 } 89 90 // Stop most of WordPress from being loaded if we just want the basics. 91 if ( SHORTINIT ) 92 return false; 93 94 // Load the l18n library. 95 require( ABSPATH . WPINC . '/l10n.php' ); 96 97 // Run the installer if WordPress is not installed. 98 wp_not_installed(); 99 100 // Load most of WordPress. 101 require ( ABSPATH . WPINC . '/formatting.php' ); 102 require( ABSPATH . WPINC . '/capabilities.php' ); 103 require( ABSPATH . WPINC . '/query.php' ); 104 require( ABSPATH . WPINC . '/theme.php' ); 105 require( ABSPATH . WPINC . '/user.php' ); 106 require( ABSPATH . WPINC . '/meta.php' ); 107 require( ABSPATH . WPINC . '/general-template.php' ); 108 require( ABSPATH . WPINC . '/link-template.php' ); 109 require( ABSPATH . WPINC . '/author-template.php' ); 110 require( ABSPATH . WPINC . '/post.php' ); 111 require( ABSPATH . WPINC . '/post-template.php' ); 112 require( ABSPATH . WPINC . '/category.php' ); 113 require( ABSPATH . WPINC . '/category-template.php' ); 114 require( ABSPATH . WPINC . '/comment.php' ); 115 require( ABSPATH . WPINC . '/comment-template.php' ); 116 require( ABSPATH . WPINC . '/rewrite.php' ); 117 require( ABSPATH . WPINC . '/feed.php' ); 118 require( ABSPATH . WPINC . '/bookmark.php' ); 119 require( ABSPATH . WPINC . '/bookmark-template.php' ); 120 require ( ABSPATH . WPINC . '/kses.php' ); 121 require( ABSPATH . WPINC . '/cron.php' ); 122 require( ABSPATH . WPINC . '/deprecated.php' ); 123 require( ABSPATH . WPINC . '/script-loader.php' ); 124 require( ABSPATH . WPINC . '/taxonomy.php' ); 125 require( ABSPATH . WPINC . '/update.php' ); 126 require( ABSPATH . WPINC . '/canonical.php' ); 127 require( ABSPATH . WPINC . '/shortcodes.php' ); 128 require( ABSPATH . WPINC . '/media.php' ); 129 require( ABSPATH . WPINC . '/http.php' ); 130 require( ABSPATH . WPINC . '/widgets.php' ); 131 require( ABSPATH . WPINC . '/nav-menu.php' ); 132 require( ABSPATH . WPINC . '/nav-menu-template.php' ); 133 134 // Load multisite-specific files. 135 if ( is_multisite() ) { 136 require( ABSPATH . WPINC . '/ms-functions.php' ); 137 require( ABSPATH . WPINC . '/ms-default-filters.php' ); 138 require( ABSPATH . WPINC . '/ms-deprecated.php' ); 139 } 140 141 // Define constants that rely on the API to obtain the default value. 142 // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. 143 wp_plugin_directory_constants( ); 144 145 // Load must-use plugins. 146 foreach ( wp_get_mu_plugins() as $mu_plugin ) { 147 include_once( $mu_plugin ); 148 } 149 unset( $mu_plugin ); 150 151 do_action( 'muplugins_loaded' ); 152 153 // Check site status if multisite. 154 if ( is_multisite() ) { 155 if ( true !== ( $file = ms_site_check() ) ) { 156 require( $file ); 157 die(); 158 } 159 unset($file); 160 161 ms_cookie_constants( ); 162 } 163 164 // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies(). 165 wp_cookie_constants( ); 166 167 // Define and enforce our SSL constants 168 wp_ssl_constants( ); 169 170 // Create common globals. 171 require( ABSPATH . WPINC . '/vars.php' ); 172 173 // Make taxonomies available to plugins and themes. 174 // @plugin authors: warning: this gets registered again on the init hook. 175 create_initial_taxonomies(); 176 177 // Load active plugins. 178 foreach ( wp_get_active_and_valid_plugins() as $plugin ) 179 include_once( $plugin ); 180 unset( $plugin ); 181 182 // Load pluggable functions. 183 require ( ABSPATH . WPINC . '/pluggable.php' ); 184 require( ABSPATH . WPINC . '/pluggable-deprecated.php' ); 185 186 // Set internal encoding. 187 wp_set_internal_encoding(); 188 189 // Run wp_cache_postload() if object cache is enabled and the function exists. 190 if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) 191 wp_cache_postload(); 192 193 do_action( 'plugins_loaded' ); 194 195 // Define constants which affect functionality if not already defined. 196 wp_functionality_constants( ); 197 198 // Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) 199 wp_magic_quotes(); 200 201 do_action( 'sanitize_comment_cookies' ); 202 203 /** 204 * WordPress Query object 205 * @global object $wp_the_query 206 * @since 2.0.0 207 */ 208 $wp_the_query =& new WP_Query(); 209 210 /** 211 * Holds the reference to @see $wp_the_query 212 * Use this global for WordPress queries 213 * @global object $wp_query 214 * @since 1.5.0 215 */ 216 $wp_query =& $wp_the_query; 217 218 /** 219 * Holds the WordPress Rewrite object for creating pretty URLs 220 * @global object $wp_rewrite 221 * @since 1.5.0 222 */ 223 $wp_rewrite =& new WP_Rewrite(); 224 225 /** 226 * WordPress Object 227 * @global object $wp 228 * @since 2.0.0 229 */ 230 $wp =& new WP(); 231 232 /** 233 * WordPress Widget Factory Object 234 * @global object $wp_widget_factory 235 * @since 2.8.0 236 */ 237 $wp_widget_factory =& new WP_Widget_Factory(); 238 239 do_action( 'setup_theme' ); 240 241 // Define the template related constants. 242 wp_templating_constants( ); 243 244 // Load the default text localization domain. 245 load_default_textdomain(); 246 247 // Find the blog locale. 248 $locale = get_locale(); 249 $locale_file = WP_LANG_DIR . "/$locale.php"; 250 if ( is_readable( $locale_file ) ) 251 require( $locale_file ); 252 unset($locale_file); 253 254 // Pull in locale data after loading text domain. 255 require( ABSPATH . WPINC . '/locale.php' ); 256 257 /** 258 * WordPress Locale object for loading locale domain date and various strings. 259 * @global object $wp_locale 260 * @since 2.1.0 261 */ 262 $wp_locale =& new WP_Locale(); 263 264 // Load the functions for the active theme, for both parent and child theme if applicable. 265 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) 266 include( STYLESHEETPATH . '/functions.php' ); 267 if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) 268 include( TEMPLATEPATH . '/functions.php' ); 269 270 do_action( 'after_setup_theme' ); 271 272 // Load any template functions the theme supports. 273 require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' ); 274 275 register_shutdown_function( 'shutdown_action_hook' ); 276 277 // Set up current user. 278 $wp->init(); 279 280 /** 281 * Most of WP is loaded at this stage, and the user is authenticated. WP continues 282 * to load on the init hook that follows (e.g. widgets), and many plugins instantiate 283 * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). 284 * 285 * If you wish to plug an action once WP is loaded, use the wp_loaded hook below. 286 */ 287 do_action( 'init' ); 288 289 /** 290 * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. 291 * 292 * AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for 293 * users not logged in. 294 * 295 * @link http://codex.wordpress.org/AJAX_in_Plugins 296 * 297 * @since 3.0.0 298 */ 299 do_action('wp_loaded'); 300 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Apr 5 14:26:09 2010 | Cross-referenced by PHPXref 0.7 |