WordPress.org

Make WordPress Core

Changeset 8781


Ignore:
Timestamp:
08/30/2008 07:51:29 PM (10 years ago)
Author:
westi
Message:

nline Documentation for script-loader.php. Fixes #7649 props jacobsantos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/script-loader.php

    r8777 r8781  
    11<?php
    2 
     2/**
     3 * WordPress scripts and styles default loader.
     4 *
     5 * Most of the functionality that existed here was moved to
     6 * {@link http://backpress.automattic.com/ BackPress}. WordPress themes and
     7 * plugins will only be concerned about the filters and actions set in this
     8 * file.
     9 *
     10 * @package WordPress
     11 */
     12
     13/** BackPress: WordPress Dependencies Class */
    314require( ABSPATH . WPINC . '/class.wp-dependencies.php' );
     15
     16/** BackPress: WordPress Scripts Class */
    417require( ABSPATH . WPINC . '/class.wp-scripts.php' );
     18
     19/** BackPress: WordPress Scripts Functions */
    520require( ABSPATH . WPINC . '/functions.wp-scripts.php' );
     21
     22/** BackPress: WordPress Styles Class */
    623require( ABSPATH . WPINC . '/class.wp-styles.php' );
     24
     25/** BackPress: WordPress Styles Functions */
    726require( ABSPATH . WPINC . '/functions.wp-styles.php' );
    827
     28/**
     29 * Setup WordPress scripts to load by default for Administration Panels.
     30 *
     31 * Localizes a few of the scripts.
     32 *
     33 * @since unknown
     34 *
     35 * @param object $scripts WP_Scripts object.
     36 */
    937function wp_default_scripts( &$scripts ) {
    1038    if (!$guessurl = site_url())
     
    218246}
    219247
     248/**
     249 * Assign default styles to $styles object.
     250 *
     251 * Nothing is returned, because the $styles parameter is passed by reference.
     252 * Meaning that whatever object is passed will be updated without having to
     253 * reassign the variable that was passed back to the same value. This saves
     254 * memory.
     255 *
     256 * Adding default styles is not the only task, it also assigns the base_url
     257 * property, the default version, and text direction for the object.
     258 *
     259 * @since 2.6.0
     260 *
     261 * @param object $styles
     262 */
     263
    220264function wp_default_styles( &$styles ) {
    221     if (!$guessurl = site_url())
     265    // This checks to see if site_url() returns something and if it does not
     266    // then it assigns $guess_url to wp_guess_url(). Strange format, but it works.
     267    if ( ! $guessurl = site_url() )
    222268        $guessurl = wp_guess_url();
    223269    $styles->base_url = $guessurl;
     
    255301}
    256302
     303/**
     304 * Reorder JavaScript scripts array to place prototype before jQuery.
     305 *
     306 * @since 2.3.1
     307 *
     308 * @param array $js_array JavaScript scripst array
     309 * @return array Reordered array, if needed.
     310 */
     311
    257312function wp_prototype_before_jquery( $js_array ) {
    258313    if ( false === $jquery = array_search( 'jquery', $js_array ) )
     
    272327}
    273328
    274 // These localizations require information that may not be loaded even by init
     329/**
     330 * Load localized script just in time for MCE.
     331 *
     332 * These localizations require information that may not be loaded even by init.
     333 *
     334 * @since 2.5.0
     335 */
    275336function wp_just_in_time_script_localization() {
    276337    wp_localize_script( 'tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) );
     
    284345}
    285346
     347/**
     348 * Administration Panel CSS for changing the styles.
     349 *
     350 * If installing the 'wp-admin/' directory will be replaced with './'.
     351 *
     352 * The $_wp_admin_css_colors global manages the Administration Panels CSS
     353 * stylesheet that is loaded. The option that is set is 'admin_color' and is the
     354 * color and key for the array. The value for the color key is an object with
     355 * a 'url' parameter that has the URL path to the CSS file.
     356 *
     357 * The query from $src parameter will be appended to the URL that is given from
     358 * the $_wp_admin_css_colors array value URL.
     359 *
     360 * @since 2.6.0
     361 * @uses $_wp_admin_css_colors
     362 *
     363 * @param string $src Source URL.
     364 * @param string $handle Either 'colors' or 'colors-rtl'.
     365 * @return string URL path to CSS stylesheet for Administration Panels.
     366 */
    286367function wp_style_loader_src( $src, $handle ) {
    287368    if ( defined('WP_INSTALLING') )
Note: See TracChangeset for help on using the changeset viewer.