mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
Code is Poetry.
WordPress' code just... wasn't. This is now dealt with. Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS. Fixes #41057. git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+24
-11
@@ -45,7 +45,7 @@ wp_check_php_mysql_versions();
|
||||
|
||||
// Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
|
||||
@ini_set( 'magic_quotes_runtime', 0 );
|
||||
@ini_set( 'magic_quotes_sybase', 0 );
|
||||
@ini_set( 'magic_quotes_sybase', 0 );
|
||||
|
||||
// WordPress calculates offsets from UTC.
|
||||
date_default_timezone_set( 'UTC' );
|
||||
@@ -128,8 +128,9 @@ if ( is_multisite() ) {
|
||||
register_shutdown_function( 'shutdown_action_hook' );
|
||||
|
||||
// Stop most of WordPress from being loaded if we just want the basics.
|
||||
if ( SHORTINIT )
|
||||
if ( SHORTINIT ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Load the L10n library.
|
||||
require_once( ABSPATH . WPINC . '/l10n.php' );
|
||||
@@ -277,8 +278,9 @@ if ( is_multisite() ) {
|
||||
*/
|
||||
do_action( 'muplugins_loaded' );
|
||||
|
||||
if ( is_multisite() )
|
||||
ms_cookie_constants( );
|
||||
if ( is_multisite() ) {
|
||||
ms_cookie_constants();
|
||||
}
|
||||
|
||||
// Define constants after multisite is loaded.
|
||||
wp_cookie_constants();
|
||||
@@ -314,8 +316,9 @@ require( ABSPATH . WPINC . '/pluggable-deprecated.php' );
|
||||
wp_set_internal_encoding();
|
||||
|
||||
// Run wp_cache_postload() if object cache is enabled and the function exists.
|
||||
if ( WP_CACHE && function_exists( 'wp_cache_postload' ) )
|
||||
if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) {
|
||||
wp_cache_postload();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires once activated plugins have loaded.
|
||||
@@ -341,6 +344,7 @@ do_action( 'sanitize_comment_cookies' );
|
||||
|
||||
/**
|
||||
* WordPress Query object
|
||||
*
|
||||
* @global WP_Query $wp_the_query
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@@ -349,6 +353,7 @@ $GLOBALS['wp_the_query'] = new WP_Query();
|
||||
/**
|
||||
* Holds the reference to @see $wp_the_query
|
||||
* Use this global for WordPress queries
|
||||
*
|
||||
* @global WP_Query $wp_query
|
||||
* @since 1.5.0
|
||||
*/
|
||||
@@ -356,6 +361,7 @@ $GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
|
||||
|
||||
/**
|
||||
* Holds the WordPress Rewrite object for creating pretty URLs
|
||||
*
|
||||
* @global WP_Rewrite $wp_rewrite
|
||||
* @since 1.5.0
|
||||
*/
|
||||
@@ -363,6 +369,7 @@ $GLOBALS['wp_rewrite'] = new WP_Rewrite();
|
||||
|
||||
/**
|
||||
* WordPress Object
|
||||
*
|
||||
* @global WP $wp
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@@ -370,6 +377,7 @@ $GLOBALS['wp'] = new WP();
|
||||
|
||||
/**
|
||||
* WordPress Widget Factory Object
|
||||
*
|
||||
* @global WP_Widget_Factory $wp_widget_factory
|
||||
* @since 2.8.0
|
||||
*/
|
||||
@@ -377,6 +385,7 @@ $GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
|
||||
|
||||
/**
|
||||
* WordPress User Roles
|
||||
*
|
||||
* @global WP_Roles $wp_roles
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@@ -390,19 +399,21 @@ $GLOBALS['wp_roles'] = new WP_Roles();
|
||||
do_action( 'setup_theme' );
|
||||
|
||||
// Define the template related constants.
|
||||
wp_templating_constants( );
|
||||
wp_templating_constants();
|
||||
|
||||
// Load the default text localization domain.
|
||||
load_default_textdomain();
|
||||
|
||||
$locale = get_locale();
|
||||
$locale = get_locale();
|
||||
$locale_file = WP_LANG_DIR . "/$locale.php";
|
||||
if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) )
|
||||
if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) {
|
||||
require( $locale_file );
|
||||
}
|
||||
unset( $locale_file );
|
||||
|
||||
/**
|
||||
* WordPress Locale object for loading locale domain date and various strings.
|
||||
*
|
||||
* @global WP_Locale $wp_locale
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@@ -420,10 +431,12 @@ $GLOBALS['wp_locale_switcher']->init();
|
||||
|
||||
// Load the functions for the active theme, for both parent and child theme if applicable.
|
||||
if ( ! wp_installing() || 'wp-activate.php' === $pagenow ) {
|
||||
if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) )
|
||||
if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) {
|
||||
include( STYLESHEETPATH . '/functions.php' );
|
||||
if ( file_exists( TEMPLATEPATH . '/functions.php' ) )
|
||||
}
|
||||
if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) {
|
||||
include( TEMPLATEPATH . '/functions.php' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -455,7 +468,7 @@ if ( is_multisite() ) {
|
||||
require( $file );
|
||||
die();
|
||||
}
|
||||
unset($file);
|
||||
unset( $file );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user