From caff68529f1f078bf4ab0563c44052621672b268 Mon Sep 17 00:00:00 2001 From: obenland Date: Sun, 24 Nov 2013 18:24:11 +0000 Subject: [PATCH] _s: Update wpcom compat file to wrap contents in a hooked callback. --- inc/wpcom.php | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/inc/wpcom.php b/inc/wpcom.php index 6e8feadf..9ed9e5ab 100644 --- a/inc/wpcom.php +++ b/inc/wpcom.php @@ -2,20 +2,29 @@ /** * WordPress.com-specific functions and definitions. * + * This file is centrally included from `wp-content/mu-plugins/wpcom-theme-compat.php`. + * * @package _s */ -global $themecolors; - /** - * Set a default theme color array for WP.com. + * Adds support for wp.com-specific theme functions. * * @global array $themecolors + * @return void */ -$themecolors = array( - 'bg' => '', - 'border' => '', - 'text' => '', - 'link' => '', - 'url' => '', -); +function _s_wpcom_setup() { + global $themecolors; + + // Set theme colors for third party services. + if ( ! isset( $themecolors ) ) { + $themecolors = array( + 'bg' => '', + 'border' => '', + 'text' => '', + 'link' => '', + 'url' => '', + ); + } +} +add_action( 'after_setup_theme', '_s_wpcom_setup' );