WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/27/2016 08:33:57 PM (5 years ago)
Author:
ocean90
Message:

Docs: Improve inline docs for WP_Dependencies, WP_Styles, and WP_Scripts.

Also, make them and related files part of WordPress.

See #35964.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class.wp-styles.php

    r36733 r36744  
    11<?php
    22/**
    3  * BackPress Styles enqueue.
     3 * Dependencies API: WP_Styles class
    44 *
    5  * These classes were refactored from the WordPress WP_Scripts and WordPress
    6  * script enqueue API.
     5 * @since 2.6.0
    76 *
    8  * @package BackPress
    9  * @since r74
     7 * @package WordPress
     8 * @subpackage Dependencies
    109 */
    1110
    1211/**
    13  * BackPress Styles enqueue class.
     12 * Core class used to register styles.
    1413 *
    15  * @package BackPress
     14 * @package WordPress
    1615 * @uses WP_Dependencies
    17  * @since r74
     16 * @since 2.6.0
    1817 */
    1918class WP_Styles extends WP_Dependencies {
     
    3029
    3130    /**
     31     * URL of the content directory.
    3232     *
    3333     * @since 2.8.0
     
    3838
    3939    /**
     40     * Default version string for stylesheets.
    4041     *
    4142     * @since 2.6.0
     
    4647
    4748    /**
     49     * The current text direction.
    4850     *
    4951     * @since 2.6.0
     
    5456
    5557    /**
     58     * Holds a list of style handles which will be concatenated.
    5659     *
    5760     * @since 2.8.0
     
    6265
    6366    /**
    64      *
    65      * @since 2.8.0
     67     * Holds a string which contains style handles and their version.
     68     *
     69     * @since 2.8.0
     70     * @deprecated 3.4.0
    6671     * @access public
    6772     * @var string
     
    7075
    7176    /**
     77     * Whether to perform concatenation.
    7278     *
    7379     * @since 2.8.0
     
    7884
    7985    /**
     86     * Holds HTML markup of styles and additional data if concatenation
     87     * is enabled.
    8088     *
    8189     * @since 2.8.0
     
    8694
    8795    /**
     96     * Holds inline styles if concatenation is enabled.
    8897     *
    8998     * @since 3.3.0
     
    94103
    95104    /**
     105     * List of default directories.
    96106     *
    97107     * @since 2.8.0
     
    119129
    120130    /**
    121      *
    122      * @since 2.6.0
    123      * @access public
    124      *
    125      * @param string $handle
    126      * @return bool
     131     * Processes a style dependency.
     132     *
     133     * @since 2.6.0
     134     * @access public
     135     *
     136     * @see WP_Dependencies::do_item()
     137     *
     138     * @param string $handle The style's registered handle.
     139     * @return bool True on success, false on failure.
    127140     */
    128141    public function do_item( $handle ) {
     
    231244
    232245    /**
     246     * Adds extra CSS styles to a registered stylesheet.
    233247     *
    234248     * @since 3.3.0
    235249     * @access public
    236250     *
    237      * @param string $handle
    238      * @param string $code
     251     * @param string $handle The style's registered handle.
     252     * @param string $code   String containing the CSS styles to be added.
     253     * @return bool True on success, false on failure.
    239254     */
    240255    public function add_inline_style( $handle, $code ) {
     
    254269
    255270    /**
     271     * Prints extra CSS styles of a registered stylesheet.
    256272     *
    257273     * @since 3.3.0
    258274     * @access public
    259275     *
    260      * @param string $handle
    261      * @param bool $echo
    262      * @return bool
     276     * @param string $handle The style's registered handle.
     277     * @param bool   $echo   Optional. Whether to echo the inline style instead of just returning it.
     278     *                       Default true.
     279     * @return string|bool False if no data exists, inline styles if `$echo` is true, true otherwise.
    263280     */
    264281    public function print_inline_style( $handle, $echo = true ) {
     
    281298
    282299    /**
    283      *
    284      * @since 2.6.0
    285      * @access public
    286      *
    287      * @param mixed $handles
    288      * @param bool $recursion
    289      * @param mixed $group
    290      * @return bool
     300     * Determines style dependencies.
     301     *
     302     * @since 2.6.0
     303     * @access public
     304     *
     305     * @see WP_Dependencies::all_deps()
     306     *
     307     * @param mixed     $handles   Item handle and argument (string) or item handles and arguments (array of strings).
     308     * @param bool      $recursion Internal flag that function is calling itself.
     309     * @param int|false $group     Group level: (int) level, (false) no groups.
     310     * @return bool True on success, false on failure.
    291311     */
    292312    public function all_deps( $handles, $recursion = false, $group = false ) {
    293313        $r = parent::all_deps( $handles, $recursion );
    294         if ( !$recursion ) {
     314        if ( ! $recursion ) {
    295315            /**
    296316             * Filter the array of enqueued styles before processing for output.
     
    306326
    307327    /**
    308      *
    309      * @since 2.6.0
    310      * @access public
    311      *
    312      * @param string $src
    313      * @param string $ver
    314      * @param string $handle
    315      * @return string
     328     * Generates an enqueued style's fully-qualified URL.
     329     *
     330     * @since 2.6.0
     331     * @access public
     332     *
     333     * @param string $src The source of the enqueued style.
     334     * @param string $ver The version of the enqueued style.
     335     * @param string $handle The style's registered handle.
     336     * @return string Style's fully-qualified URL.
    316337     */
    317338    public function _css_href( $src, $ver, $handle ) {
     
    336357
    337358    /**
    338      *
    339      * @since 2.8.0
    340      * @access public
    341      *
    342      * @param string $src
    343      * @return bool
     359     * Whether a handle's source is in a default directory.
     360     *
     361     * @since 2.8.0
     362     * @access public
     363     *
     364     * @param string $src The source of the enqueued style.
     365     * @return bool True if found, false if not.
    344366     */
    345367    public function in_default_dir( $src ) {
     
    355377
    356378    /**
     379     * Processes items and dependencies for the footer group.
    357380     *
    358381     * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
     
    361384     * @access public
    362385     *
    363      * @return array
     386     * @see WP_Dependencies::do_items()
     387     *
     388     * @return array Handles of items that have been processed.
    364389     */
    365390    public function do_footer_items() {
     
    369394
    370395    /**
     396     * Resets class properties.
    371397     *
    372398     * @since 3.3.0
Note: See TracChangeset for help on using the changeset viewer.