Commit c2f15cf7 authored by Andrew Nacin's avatar Andrew Nacin
Browse files

Make sure color schemes are registered when WP_Styles is initialized early.

fixes #27175. see #26669.

Built from https://develop.svn.wordpress.org/trunk@27228


git-svn-id: https://core.svn.wordpress.org/trunk@27085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent eecfec93
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -578,6 +578,11 @@ function wp_default_styles( &$styles ) {

	// Register a stylesheet for the selected admin color scheme.
	$colors_url = false;
	// It's possible this is run before admin_init, so we need to make sure color schemes are registered.
	if ( is_admin() && empty( $GLOBALS['_wp_admin_css_colors'] ) && ! did_action( 'admin_init' ) && has_action( 'admin_init', 'register_admin_color_schemes' ) ) {
		register_admin_color_schemes();
		remove_action( 'admin_init', 'register_admin_color_schemes', 1 );
	}
	if ( ! empty( $GLOBALS['_wp_admin_css_colors'] ) ) {
		$color = get_user_option( 'admin_color' );
		if ( ! $color || ! isset( $GLOBALS['_wp_admin_css_colors'][ $color ] ) ) {