Advertisements

wp_default_styles

Definition:
function wp_default_styles( &$styles ) {}

Assign default styles to $styles object.
Nothing is returned, because the $styles parameter is passed by reference. Meaning that whatever object is passed will be updated without having to reassign the variable that was passed back to the same value. This saves memory.

Parameters

  • object $styles
  • &$styles

Source code

function wp_default_styles( &$styles ) {

	// This checks to see if site_url() returns something and if it does not

	// then it assigns $guess_url to wp_guess_url(). Strange format, but it works.

	if ( ! $guessurl = site_url() )

		$guessurl = wp_guess_url();



	$styles->base_url = $guessurl;

	$styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';

	$styles->default_version = get_bloginfo( 'version' );

	$styles->text_direction = function_exists( 'is_rtl' ) && is_rtl() ? 'rtl' : 'ltr';

	$styles->default_dirs = array('/wp-admin/', '/wp-includes/css/');



	$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';



	$rtl_styles = array( 'wp-admin', 'ie', 'media', 'admin-bar', 'wplink' );

	// Any rtl stylesheets that don't have a .dev version for ltr

	$no_suffix = array( 'farbtastic' );



	$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20111208' );



	$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20111130' );

	$styles->add_data( 'ie', 'conditional', 'lte IE 7' );



	// all colors stylesheets need to have the same query strings (cache manifest compat)

	$colors_version = '20111206';



	// Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string.

	$styles->add( 'colors', true, array('wp-admin'), $colors_version );



	// do not refer to these directly, the right one is queued by the above "meta" colors handle

	$styles->add( 'colors-fresh', "/wp-admin/css/colors-fresh$suffix.css", array('wp-admin'), $colors_version );

	$styles->add( 'colors-classic', "/wp-admin/css/colors-classic$suffix.css", array('wp-admin'), $colors_version );



	$styles->add( 'media', "/wp-admin/css/media$suffix.css", array(), '20111119' );

	$styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20111117' ); // Readme as well

	$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20111117' );

	$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' );

	$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );

	$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );

	$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20111209' );

	$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20111107' );

	$styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20111114' );

	$styles->add( 'wp-pointer', "/wp-includes/css/wp-pointer$suffix.css", array(), '20111205' );



	foreach ( $rtl_styles as $rtl_style ) {

		$styles->add_data( $rtl_style, 'rtl', true );

		if ( $suffix && ! in_array( $rtl_style, $no_suffix ) )

			$styles->add_data( $rtl_style, 'suffix', $suffix );

	}

}

3577

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: