Make WordPress Core

Changeset 36993


Ignore:
Timestamp:
03/14/2016 10:36:26 PM (9 years ago)
Author:
johnbillion
Message:

Docs: Improvements and corrections for the $ver parameter of the dependencies API functions.

See #32246

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r36871 r36993  
    205205     * @since 2.6.0 Moved from `WP_Scripts`.
    206206     *
    207      * @param string $handle Unique item name.
    208      * @param string $src    The item url.
    209      * @param array  $deps   Optional. An array of item handle strings on which this item depends.
    210      * @param string $ver    Optional. Version (used for cache busting).
    211      * @param mixed  $args   Optional. Custom property of the item. NOT the class property $args. Examples: $media, $in_footer.
     207     * @param string           $handle Name of the item. Should be unique.
     208     * @param string           $src    Full URL of the item, or path of the item relative to the WordPress root directory.
     209     * @param array            $deps   Optional. An array of registered item handles this item depends on. Default empty array.
     210     * @param string|bool|null $ver    Optional. String specifying item version number, if it has one, which is added to the URL
     211     *                                 as a query string for cache busting purposes. If version is set to false, a version
     212     *                                 number is automatically added equal to current installed WordPress version.
     213     *                                 If set to null, no version is added.
    212214     * @return bool Whether the item has been registered. True on success, false on failure.
    213215     */
  • trunk/src/wp-includes/functions.wp-scripts.php

    r36744 r36993  
    9898 * @see WP_Scripts::add_inline_script()
    9999 *
    100  * @param string $handle   Name of the script to add the inline script to. Must be lowercase.
     100 * @param string $handle   Name of the script to add the inline script to.
    101101 * @param string $data     String containing the javascript to be added.
    102102 * @param string $position Optional. Whether to add the inline script before the handle
     
    118118 * Register a new script.
    119119 *
    120  * Registers a script to be linked later using the wp_enqueue_script() function.
     120 * Registers a script to be enqueued later using the wp_enqueue_script() function.
    121121 *
    122122 * @see WP_Dependencies::add()
     
    126126 * @since 4.3.0 A return value was added.
    127127 *
    128  * @param string      $handle    Name of the script. Should be unique.
    129  * @param string      $src       Path to the script from the WordPress root directory. Example: '/js/myscript.js'.
    130  * @param array       $deps      Optional. An array of registered script handles this script depends on. Set to false if there
    131  *                               are no dependencies. Default empty array.
    132  * @param string|bool $ver       Optional. String specifying script version number, if it has one, which is concatenated
    133  *                               to end of path as a query string. If no version is specified or set to false, a version
    134  *                               number is automatically added equal to current installed WordPress version.
    135  *                               If set to null, no version is added. Default 'false'. Accepts 'false', 'null', or 'string'.
    136  * @param bool        $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
    137  *                               Default 'false'. Accepts 'false' or 'true'.
     128 * @param string           $handle    Name of the script. Should be unique.
     129 * @param string           $src       Full URL of the script, or path of the script relative to the WordPress root directory.
     130 * @param array            $deps      Optional. An array of registered script handles this script depends on. Default empty array.
     131 * @param string|bool|null $ver       Optional. String specifying script version number, if it has one, which is added to the URL
     132 *                                    as a query string for cache busting purposes. If version is set to false, a version
     133 *                                    number is automatically added equal to current installed WordPress version.
     134 *                                    If set to null, no version is added.
     135 * @param bool             $in_footer Optional. Whether to enqueue the script before </body> instead of in the <head>.
     136 *                                    Default 'false'.
    138137 * @return bool Whether the script has been registered. True on success, false on failure.
    139138 */
     
    242241 * @since 2.1.0
    243242 *
    244  * @param string      $handle    Name of the script.
    245  * @param string|bool $src       Path to the script from the root directory of WordPress. Example: '/js/myscript.js'.
    246  * @param array       $deps      An array of registered handles this script depends on. Default empty array.
    247  * @param string|bool $ver       Optional. String specifying the script version number, if it has one. This parameter
    248  *                               is used to ensure that the correct version is sent to the client regardless of caching,
    249  *                               and so should be included if a version number is available and makes sense for the script.
    250  * @param bool        $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
    251  *                               Default 'false'. Accepts 'false' or 'true'.
     243 * @param string           $handle    Name of the script. Should be unique.
     244 * @param string           $src       Full URL of the script, or path of the script relative to the WordPress root directory.
     245 * @param array            $deps      Optional. An array of registered script handles this script depends on. Default empty array.
     246 * @param string|bool|null $ver       Optional. String specifying script version number, if it has one, which is added to the URL
     247 *                                    as a query string for cache busting purposes. If version is set to false, a version
     248 *                                    number is automatically added equal to current installed WordPress version.
     249 *                                    If set to null, no version is added.
     250 * @param bool             $in_footer Optional. Whether to enqueue the script before </body> instead of in the <head>.
     251 *                                    Default 'false'.
    252252 */
    253253function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
  • trunk/src/wp-includes/functions.wp-styles.php

    r36744 r36993  
    7777 * @since 3.3.0
    7878 *
    79  * @param string $handle Name of the stylesheet to add the extra styles to. Must be lowercase.
     79 * @param string $handle Name of the stylesheet to add the extra styles to.
    8080 * @param string $data   String containing the CSS styles to be added.
    8181 * @return bool True on success, false on failure.
     
    101101 * @since 4.3.0 A return value was added.
    102102 *
    103  * @param string      $handle Name of the stylesheet.
    104  * @param string|bool $src    Path to the stylesheet from the WordPress root directory. Example: '/css/mystyle.css'.
    105  * @param array       $deps   An array of registered style handles this stylesheet depends on. Default empty array.
    106  * @param string|bool $ver    String specifying the stylesheet version number. Used to ensure that the correct version
    107  *                            is sent to the client regardless of caching. Default 'false'. Accepts 'false', 'null', or 'string'.
    108  * @param string      $media  Optional. The media for which this stylesheet has been defined.
    109  *                            Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like
    110  *                            '(orientation: portrait)' and '(max-width: 640px)'.
    111  *
     103 * @param string           $handle Name of the stylesheet. Should be unique.
     104 * @param string           $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
     105 * @param array            $deps   Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
     106 * @param string|bool|null $ver    Optional. String specifying stylesheet version number, if it has one, which is added to the URL
     107 *                                 as a query string for cache busting purposes. If version is set to false, a version
     108 *                                 number is automatically added equal to current installed WordPress version.
     109 *                                 If set to null, no version is added.
     110 * @param string           $media  Optional. The media for which this stylesheet has been defined.
     111 *                                 Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like
     112 *                                 '(orientation: portrait)' and '(max-width: 640px)'.
    112113 * @return bool Whether the style has been registered. True on success, false on failure.
    113114 */
     
    144145 * @since 2.6.0
    145146 *
    146  * @param string      $handle Name of the stylesheet.
    147  * @param string|bool $src    Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
    148  * @param array       $deps   An array of registered style handles this stylesheet depends on. Default empty array.
    149  * @param string|bool $ver    String specifying the stylesheet version number, if it has one. This parameter is used
    150  *                            to ensure that the correct version is sent to the client regardless of caching, and so
    151  *                            should be included if a version number is available and makes sense for the stylesheet.
    152  * @param string      $media  Optional. The media for which this stylesheet has been defined.
    153  *                            Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like
    154  *                            '(orientation: portrait)' and '(max-width: 640px)'.
     147 * @param string           $handle Name of the stylesheet. Should be unique.
     148 * @param string           $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
     149 * @param array            $deps   Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
     150 * @param string|bool|null $ver    Optional. String specifying stylesheet version number, if it has one, which is added to the URL
     151 *                                 as a query string for cache busting purposes. If version is set to false, a version
     152 *                                 number is automatically added equal to current installed WordPress version.
     153 *                                 If set to null, no version is added.
     154 * @param string           $media  Optional. The media for which this stylesheet has been defined.
     155 *                                 Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like
     156 *                                 '(orientation: portrait)' and '(max-width: 640px)'.
    155157 */
    156158function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) {
Note: See TracChangeset for help on using the changeset viewer.