Tighten our braces. Fixes #23118 props evansolomon.
git-svn-id: http://core.svn.wordpress.org/trunk@23265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2428b370a2
commit
f683fc7677
|
@ -232,7 +232,7 @@ function wp_dashboard_right_now() {
|
||||||
|
|
||||||
$num_tags = wp_count_terms('post_tag');
|
$num_tags = wp_count_terms('post_tag');
|
||||||
|
|
||||||
$num_comm = wp_count_comments( );
|
$num_comm = wp_count_comments();
|
||||||
|
|
||||||
echo "\n\t".'<div class="table table_content">';
|
echo "\n\t".'<div class="table table_content">';
|
||||||
echo "\n\t".'<p class="sub">' . __('Content') . '</p>'."\n\t".'<table>';
|
echo "\n\t".'<p class="sub">' . __('Content') . '</p>'."\n\t".'<table>';
|
||||||
|
|
|
@ -28,14 +28,14 @@ $theme_field_defaults = array( 'description' => true, 'sections' => false, 'test
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function install_themes_feature_list( ) {
|
function install_themes_feature_list() {
|
||||||
if ( !$cache = get_transient( 'wporg_theme_feature_list' ) )
|
if ( !$cache = get_transient( 'wporg_theme_feature_list' ) )
|
||||||
set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
|
set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
|
||||||
|
|
||||||
if ( $cache )
|
if ( $cache )
|
||||||
return $cache;
|
return $cache;
|
||||||
|
|
||||||
$feature_list = themes_api( 'feature_list', array( ) );
|
$feature_list = themes_api( 'feature_list', array() );
|
||||||
if ( is_wp_error( $feature_list ) )
|
if ( is_wp_error( $feature_list ) )
|
||||||
return $features;
|
return $features;
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ function install_themes_dashboard() {
|
||||||
<form method="get" action="">
|
<form method="get" action="">
|
||||||
<input type="hidden" name="tab" value="search" />
|
<input type="hidden" name="tab" value="search" />
|
||||||
<?php
|
<?php
|
||||||
$feature_list = get_theme_feature_list( );
|
$feature_list = get_theme_feature_list();
|
||||||
echo '<div class="feature-filter">';
|
echo '<div class="feature-filter">';
|
||||||
|
|
||||||
foreach ( (array) $feature_list as $feature_name => $features ) {
|
foreach ( (array) $feature_list as $feature_name => $features ) {
|
||||||
|
|
|
@ -216,10 +216,10 @@ function get_theme_feature_list( $api = true ) {
|
||||||
return $features;
|
return $features;
|
||||||
|
|
||||||
if ( !$feature_list = get_site_transient( 'wporg_theme_feature_list' ) )
|
if ( !$feature_list = get_site_transient( 'wporg_theme_feature_list' ) )
|
||||||
set_site_transient( 'wporg_theme_feature_list', array( ), 10800);
|
set_site_transient( 'wporg_theme_feature_list', array(), 10800);
|
||||||
|
|
||||||
if ( !$feature_list ) {
|
if ( !$feature_list ) {
|
||||||
$feature_list = themes_api( 'feature_list', array( ) );
|
$feature_list = themes_api( 'feature_list', array() );
|
||||||
if ( is_wp_error( $feature_list ) )
|
if ( is_wp_error( $feature_list ) )
|
||||||
return $features;
|
return $features;
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
|
||||||
update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
|
update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
|
||||||
update_option( 'widget_categories', array ( 2 => array ( 'title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
|
update_option( 'widget_categories', array ( 2 => array ( 'title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
|
||||||
update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
|
update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
|
||||||
update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array ( ), 'sidebar-1' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'sidebar-2' => array ( ), 'sidebar-3' => array ( ), 'array_version' => 3 ) );
|
update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array (), 'sidebar-1' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'sidebar-2' => array (), 'sidebar-3' => array (), 'array_version' => 3 ) );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
if ( ! is_multisite() )
|
||||||
update_user_meta( $user_id, 'show_welcome_panel', 1 );
|
update_user_meta( $user_id, 'show_welcome_panel', 1 );
|
||||||
|
|
|
@ -415,7 +415,7 @@ class WP_Comment_Query {
|
||||||
*
|
*
|
||||||
* @return array List of comment statuses.
|
* @return array List of comment statuses.
|
||||||
*/
|
*/
|
||||||
function get_comment_statuses( ) {
|
function get_comment_statuses() {
|
||||||
$status = array(
|
$status = array(
|
||||||
'hold' => __('Unapproved'),
|
'hold' => __('Unapproved'),
|
||||||
/* translators: comment status */
|
/* translators: comment status */
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
function wp_initial_constants( ) {
|
function wp_initial_constants() {
|
||||||
global $blog_id;
|
global $blog_id;
|
||||||
|
|
||||||
// set memory limits
|
// set memory limits
|
||||||
|
@ -89,7 +89,7 @@ function wp_initial_constants( ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
function wp_plugin_directory_constants( ) {
|
function wp_plugin_directory_constants() {
|
||||||
if ( !defined('WP_CONTENT_URL') )
|
if ( !defined('WP_CONTENT_URL') )
|
||||||
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
|
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ function wp_plugin_directory_constants( ) {
|
||||||
* Defines constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
|
* Defines constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
function wp_cookie_constants( ) {
|
function wp_cookie_constants() {
|
||||||
/**
|
/**
|
||||||
* Used to guarantee unique hash cookies
|
* Used to guarantee unique hash cookies
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
|
@ -235,7 +235,7 @@ function wp_cookie_constants( ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
function wp_ssl_constants( ) {
|
function wp_ssl_constants() {
|
||||||
/**
|
/**
|
||||||
* @since 2.6.0
|
* @since 2.6.0
|
||||||
*/
|
*/
|
||||||
|
@ -256,7 +256,7 @@ function wp_ssl_constants( ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
function wp_functionality_constants( ) {
|
function wp_functionality_constants() {
|
||||||
/**
|
/**
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*/
|
*/
|
||||||
|
@ -284,7 +284,7 @@ function wp_functionality_constants( ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
function wp_templating_constants( ) {
|
function wp_templating_constants() {
|
||||||
/**
|
/**
|
||||||
* Filesystem path to the current active template directory
|
* Filesystem path to the current active template directory
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
|
|
|
@ -2977,7 +2977,7 @@ function wp_pre_kses_less_than_callback( $matches ) {
|
||||||
* @return string The formatted string.
|
* @return string The formatted string.
|
||||||
*/
|
*/
|
||||||
function wp_sprintf( $pattern ) {
|
function wp_sprintf( $pattern ) {
|
||||||
$args = func_get_args( );
|
$args = func_get_args();
|
||||||
$len = strlen($pattern);
|
$len = strlen($pattern);
|
||||||
$start = 0;
|
$start = 0;
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
|
@ -861,7 +861,7 @@ function get_post_status($ID = '') {
|
||||||
*
|
*
|
||||||
* @return array List of post statuses.
|
* @return array List of post statuses.
|
||||||
*/
|
*/
|
||||||
function get_post_statuses( ) {
|
function get_post_statuses() {
|
||||||
$status = array(
|
$status = array(
|
||||||
'draft' => __('Draft'),
|
'draft' => __('Draft'),
|
||||||
'pending' => __('Pending Review'),
|
'pending' => __('Pending Review'),
|
||||||
|
@ -882,7 +882,7 @@ function get_post_statuses( ) {
|
||||||
*
|
*
|
||||||
* @return array List of page statuses.
|
* @return array List of page statuses.
|
||||||
*/
|
*/
|
||||||
function get_page_statuses( ) {
|
function get_page_statuses() {
|
||||||
$status = array(
|
$status = array(
|
||||||
'draft' => __('Draft'),
|
'draft' => __('Draft'),
|
||||||
'private' => __('Private'),
|
'private' => __('Private'),
|
||||||
|
@ -2173,7 +2173,7 @@ function wp_count_attachments( $mime_type = '' ) {
|
||||||
$and = wp_post_mime_type_where( $mime_type );
|
$and = wp_post_mime_type_where( $mime_type );
|
||||||
$count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A );
|
$count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A );
|
||||||
|
|
||||||
$stats = array( );
|
$stats = array();
|
||||||
foreach( (array) $count as $row ) {
|
foreach( (array) $count as $row ) {
|
||||||
$stats[$row['post_mime_type']] = $row['num_posts'];
|
$stats[$row['post_mime_type']] = $row['num_posts'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,13 +51,13 @@ function wp_version_check() {
|
||||||
else
|
else
|
||||||
$mysql_version = 'N/A';
|
$mysql_version = 'N/A';
|
||||||
|
|
||||||
if ( is_multisite( ) ) {
|
if ( is_multisite() ) {
|
||||||
$user_count = get_user_count( );
|
$user_count = get_user_count();
|
||||||
$num_blogs = get_blog_count( );
|
$num_blogs = get_blog_count();
|
||||||
$wp_install = network_site_url( );
|
$wp_install = network_site_url();
|
||||||
$multisite_enabled = 1;
|
$multisite_enabled = 1;
|
||||||
} else {
|
} else {
|
||||||
$user_count = count_users( );
|
$user_count = count_users();
|
||||||
$user_count = $user_count['total_users'];
|
$user_count = $user_count['total_users'];
|
||||||
$multisite_enabled = 0;
|
$multisite_enabled = 0;
|
||||||
$num_blogs = 1;
|
$num_blogs = 1;
|
||||||
|
@ -274,7 +274,7 @@ function wp_update_themes() {
|
||||||
$timeout = 12 * HOUR_IN_SECONDS;
|
$timeout = 12 * HOUR_IN_SECONDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
$time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time( ) - $last_update->last_checked );
|
$time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked );
|
||||||
|
|
||||||
if ( $time_not_changed ) {
|
if ( $time_not_changed ) {
|
||||||
$theme_changed = false;
|
$theme_changed = false;
|
||||||
|
@ -313,7 +313,7 @@ function wp_update_themes() {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$new_update = new stdClass;
|
$new_update = new stdClass;
|
||||||
$new_update->last_checked = time( );
|
$new_update->last_checked = time();
|
||||||
$new_update->checked = $checked;
|
$new_update->checked = $checked;
|
||||||
|
|
||||||
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
|
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
|
||||||
|
@ -404,9 +404,9 @@ function _maybe_update_plugins() {
|
||||||
* @since 2.7.0
|
* @since 2.7.0
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _maybe_update_themes( ) {
|
function _maybe_update_themes() {
|
||||||
$current = get_site_transient( 'update_themes' );
|
$current = get_site_transient( 'update_themes' );
|
||||||
if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time( ) - $current->last_checked ) )
|
if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wp_update_themes();
|
wp_update_themes();
|
||||||
|
|
|
@ -23,7 +23,7 @@ require( ABSPATH . WPINC . '/default-constants.php' );
|
||||||
require( ABSPATH . WPINC . '/version.php' );
|
require( ABSPATH . WPINC . '/version.php' );
|
||||||
|
|
||||||
// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
|
// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
|
||||||
wp_initial_constants( );
|
wp_initial_constants();
|
||||||
|
|
||||||
// Check for the required PHP version and for the MySQL extension or a database drop-in.
|
// Check for the required PHP version and for the MySQL extension or a database drop-in.
|
||||||
wp_check_php_mysql_versions();
|
wp_check_php_mysql_versions();
|
||||||
|
@ -152,7 +152,7 @@ if ( is_multisite() ) {
|
||||||
|
|
||||||
// Define constants that rely on the API to obtain the default value.
|
// Define constants that rely on the API to obtain the default value.
|
||||||
// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
|
// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
|
||||||
wp_plugin_directory_constants( );
|
wp_plugin_directory_constants();
|
||||||
|
|
||||||
// Load must-use plugins.
|
// Load must-use plugins.
|
||||||
foreach ( wp_get_mu_plugins() as $mu_plugin ) {
|
foreach ( wp_get_mu_plugins() as $mu_plugin ) {
|
||||||
|
@ -174,10 +174,10 @@ if ( is_multisite() )
|
||||||
ms_cookie_constants( );
|
ms_cookie_constants( );
|
||||||
|
|
||||||
// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
|
// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
|
||||||
wp_cookie_constants( );
|
wp_cookie_constants();
|
||||||
|
|
||||||
// Define and enforce our SSL constants
|
// Define and enforce our SSL constants
|
||||||
wp_ssl_constants( );
|
wp_ssl_constants();
|
||||||
|
|
||||||
// Create common globals.
|
// Create common globals.
|
||||||
require( ABSPATH . WPINC . '/vars.php' );
|
require( ABSPATH . WPINC . '/vars.php' );
|
||||||
|
@ -209,7 +209,7 @@ if ( WP_CACHE && function_exists( 'wp_cache_postload' ) )
|
||||||
do_action( 'plugins_loaded' );
|
do_action( 'plugins_loaded' );
|
||||||
|
|
||||||
// Define constants which affect functionality if not already defined.
|
// Define constants which affect functionality if not already defined.
|
||||||
wp_functionality_constants( );
|
wp_functionality_constants();
|
||||||
|
|
||||||
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
|
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
|
||||||
wp_magic_quotes();
|
wp_magic_quotes();
|
||||||
|
|
Loading…
Reference in New Issue