Changes from trunk/wp-includes/load.php at r17194 to branches/3.0/wp-includes/load.php at r15967
- File:
-
- 1 edited
-
branches/3.0/wp-includes/load.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-includes/load.php
r17194 r15967 257 257 function wp_debug_mode() { 258 258 if ( WP_DEBUG ) { 259 // E_DEPRECATED is a core PHP constant in PHP 5.3. Don't define this yourself.260 // The two statements are equivalent, just one is for 5.3+ and for less than 5.3.261 259 if ( defined( 'E_DEPRECATED' ) ) 262 260 error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT ); … … 311 309 312 310 /** 313 * Load the correct database class file.314 *315 * This function is used to load the database class file either at runtime or by316 * wp-admin/setup-config.php. We must globalize $wpdb to ensure that it is317 * defined globally by the inline code in wp-db.php.318 *319 * @since 2.5.0320 * @global $wpdb WordPress Database Object321 */322 function require_wp_db() {323 global $wpdb;324 325 require_once( ABSPATH . WPINC . '/wp-db.php' );326 if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )327 require_once( WP_CONTENT_DIR . '/db.php' );328 329 if ( isset( $wpdb ) )330 return;331 332 $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );333 }334 335 /**336 311 * Sets the database table prefix and the format specifiers for database table columns. 337 312 * … … 404 379 405 380 if ( function_exists( 'wp_cache_add_global_groups' ) ) { 406 wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', ' user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );381 wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) ); 407 382 wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) ); 408 383 } … … 422 397 wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); 423 398 } elseif ( ! is_blog_installed() && false === strpos( $_SERVER['PHP_SELF'], 'install.php' ) && !defined( 'WP_INSTALLING' ) ) { 424 425 $link = wp_guess_url() . '/wp-admin/install.php'; 426 399 if ( defined( 'WP_SITEURL' ) ) 400 $link = WP_SITEURL . '/wp-admin/install.php'; 401 elseif ( false !== strpos( $_SERVER['PHP_SELF'], 'wp-admin' ) ) 402 $link = preg_replace( '|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php'; 403 else 404 $link = preg_replace( '|/[^/]+?$|', '/', $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php'; 427 405 require( ABSPATH . WPINC . '/kses.php' ); 428 406 require( ABSPATH . WPINC . '/pluggable.php' ); … … 475 453 $active_plugins = (array) get_option( 'active_plugins', array() ); 476 454 455 // Get active network plugins 456 if ( is_multisite() ) { 457 $active_sitewide_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); 458 if ( !empty($active_sitewide_plugins) ) { 459 $active_plugins = array_merge( $active_plugins, array_keys( $active_sitewide_plugins ) ); 460 sort( $active_plugins ); 461 } 462 } 463 477 464 // Check for hacks file if the option is enabled 478 465 if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { … … 484 471 return $plugins; 485 472 486 $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false;487 488 473 foreach ( $active_plugins as $plugin ) { 489 474 if ( ! validate_file( $plugin ) // $plugin must validate as file 490 475 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' 491 476 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 492 // not already included as a network plugin493 && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) )494 477 ) 495 478 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; … … 571 554 572 555 /** 573 * Whether the current request is for a network or blog admin page556 * Whether the current request is in WordPress admin Panel 574 557 * 575 558 * Does not inform on whether the user is an admin! Use capability checks to … … 587 570 588 571 /** 589 * Whether the current request is for a blog admin screen /wp-admin/590 *591 * Does not inform on whether the user is a blog admin! Use capability checks to592 * tell if the user should be accessing a section or not.593 *594 * @since 3.1.0595 *596 * @return bool True if inside WordPress network administration pages.597 */598 function is_blog_admin() {599 if ( defined( 'WP_BLOG_ADMIN' ) )600 return WP_BLOG_ADMIN;601 return false;602 }603 604 /**605 * Whether the current request is for a network admin screen /wp-admin/network/606 *607 * Does not inform on whether the user is a network admin! Use capability checks to608 * tell if the user should be accessing a section or not.609 *610 * @since 3.1.0611 *612 * @return bool True if inside WordPress network administration pages.613 */614 function is_network_admin() {615 if ( defined( 'WP_NETWORK_ADMIN' ) )616 return WP_NETWORK_ADMIN;617 return false;618 }619 620 /**621 * Whether the current request is for a user admin screen /wp-admin/user/622 *623 * Does not inform on whether the user is an admin! Use capability checks to624 * tell if the user should be accessing a section or not.625 *626 * @since 3.1.0627 *628 * @return bool True if inside WordPress user administration pages.629 */630 function is_user_admin() {631 if ( defined( 'WP_USER_ADMIN' ) )632 return WP_USER_ADMIN;633 return false;634 }635 636 /**637 572 * Whether Multisite support is enabled 638 573 *
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)