raw
mp-wp_genesis           1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * WordPress scripts and styles default loader.
mp-wp_genesis 4 *
mp-wp_genesis 5 * Most of the functionality that existed here was moved to
mp-wp_genesis 6 * {@link http://backpress.automattic.com/ BackPress}. WordPress themes and
mp-wp_genesis 7 * plugins will only be concerned about the filters and actions set in this
mp-wp_genesis 8 * file.
mp-wp_genesis 9 *
mp-wp_genesis 10 * @package WordPress
mp-wp_genesis 11 */
mp-wp_genesis 12
mp-wp_genesis 13 /** BackPress: WordPress Dependencies Class */
mp-wp_genesis 14 require( ABSPATH . WPINC . '/class.wp-dependencies.php' );
mp-wp_genesis 15
mp-wp_genesis 16 /** BackPress: WordPress Styles Class */
mp-wp_genesis 17 require( ABSPATH . WPINC . '/class.wp-styles.php' );
mp-wp_genesis 18
mp-wp_genesis 19 /** BackPress: WordPress Styles Functions */
mp-wp_genesis 20 require( ABSPATH . WPINC . '/functions.wp-styles.php' );
mp-wp_genesis 21
mp-wp_genesis 22 /**
mp-wp_genesis 23 * Assign default styles to $styles object.
mp-wp_genesis 24 *
mp-wp_genesis 25 * Nothing is returned, because the $styles parameter is passed by reference.
mp-wp_genesis 26 * Meaning that whatever object is passed will be updated without having to
mp-wp_genesis 27 * reassign the variable that was passed back to the same value. This saves
mp-wp_genesis 28 * memory.
mp-wp_genesis 29 *
mp-wp_genesis 30 * Adding default styles is not the only task, it also assigns the base_url
mp-wp_genesis 31 * property, the default version, and text direction for the object.
mp-wp_genesis 32 *
mp-wp_genesis 33 * @since 2.6.0
mp-wp_genesis 34 *
mp-wp_genesis 35 * @param object $styles
mp-wp_genesis 36 */
mp-wp_genesis 37 function wp_default_styles( &$styles ) {
mp-wp_genesis 38 // This checks to see if site_url() returns something and if it does not
mp-wp_genesis 39 // then it assigns $guess_url to wp_guess_url(). Strange format, but it works.
mp-wp_genesis 40 if ( ! $guessurl = site_url() )
mp-wp_genesis 41 $guessurl = wp_guess_url();
mp-wp_genesis 42 $styles->base_url = $guessurl;
mp-wp_genesis 43 $styles->default_version = get_bloginfo( 'version' );
mp-wp_genesis 44
mp-wp_remove-all-... 45 $styles->add( 'wp-admin', '/wp-admin/css/wp-admin.css', array(), '20081210' );
mp-wp_genesis 46
mp-wp_genesis 47 $styles->add( 'colors', true, array(), '20081210' ); // Register "meta" stylesheet for admin colors
mp-wp_genesis 48 $styles->add( 'colors-fresh', '/wp-admin/css/colors-fresh.css', array(), '20081210'); // for login.php. Is there a better way?
mp-wp_genesis 49 $styles->add( 'colors-classic', '/wp-admin/css/colors-classic.css', array(), '20081210');
mp-wp_genesis 50
mp-wp_genesis 51 $styles->add( 'global', '/wp-admin/css/global.css', array(), '20081210' );
mp-wp_genesis 52 $styles->add( 'media', '/wp-admin/css/media.css', array(), '20081210' );
mp-wp_genesis 53 $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20081210' );
mp-wp_genesis 54 $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20081210' );
mp-wp_genesis 55 $styles->add( 'install', '/wp-admin/css/install.css', array(), '20081210' );
mp-wp_genesis 56 $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css', array(), '20081210' );
mp-wp_genesis 57 $styles->add( 'login', '/wp-admin/css/login.css', array(), '20081210' );
mp-wp_genesis 58 $styles->add( 'plugin-install', '/wp-admin/css/plugin-install.css', array(), '20081210' );
mp-wp_genesis 59 $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
mp-wp_genesis 60 }
mp-wp_genesis 61
mp-wp_genesis 62 add_action( 'wp_default_styles', 'wp_default_styles' );