WordPress.org

Make WordPress Core

Ticket #18753: 18753.2.diff

File 18753.2.diff, 2.2 KB (added by nacin, 5 years ago)
  • wp-content/themes/twentythirteen/functions.php

     
    156156 * @return void
    157157 */
    158158function twentythirteen_scripts_styles() {
    159         global $wp_styles;
    160 
    161159        // Adds JavaScript to pages with the comment form to support sites with
    162160        // threaded comments (when in use).
    163161        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
     
    181179
    182180        // Loads the Internet Explorer specific stylesheet.
    183181        wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '2013-07-18' );
    184         $wp_styles->add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' );
     182        wp_style_add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' );
    185183}
    186184add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );
    187185
  • wp-includes/functions.wp-styles.php

     
    190190
    191191        return (bool) $wp_styles->query( $handle, $list );
    192192}
     193
     194/**
     195 * Add metadata to CSS style files.
     196 *
     197 * Works only if the stylesheet has already been added.
     198 * Possible values for $key and $value:
     199 *
     200 * conditional string      comments for IE 6, lte IE 7 etc.
     201 * rtl         bool|string to declare an RTL stylesheet
     202 * suffix      string      optional suffix, used in combination with RTL
     203 * alt         bool        for rel="alternate stylesheet"
     204 * title       string      for preferred/alternate stylesheets
     205 *
     206 * @since 3.6.0
     207 * @see WP_Dependencies::add_data()
     208 *
     209 * @param string $handle Script name.
     210 * @param string $key Name of data point for which we're storing a value.
     211 *  Values are 'conditional', 'rtl', and 'suffix', and 'alt', 'title'.
     212 * @param mixed $data
     213 * @return bool True on success, false on failure.
     214 */
     215function wp_style_add_data( $handle, $key, $value ) {
     216        global $wp_styles;
     217        return $wp_styles->add_data( $handle, $key, $value );
     218}