Changeset 36649
- Timestamp:
- 02/23/2016 08:40:43 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.wp-styles.php
r36074 r36649 107 107 * is sent to the client regardless of caching. Default 'false'. Accepts 'false', 'null', or 'string'. 108 108 * @param string $media Optional. The media for which this stylesheet has been defined. 109 * Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print', 110 * 'screen', 'tty', or 'tv'. 109 * Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like 110 * '(orientation: portrait)' and '(max-width: 640px)'. 111 * 111 112 * @return bool Whether the style has been registered. True on success, false on failure. 112 113 */ … … 150 151 * should be included if a version number is available and makes sense for the stylesheet. 151 152 * @param string $media Optional. The media for which this stylesheet has been defined. 152 * Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print',153 * ' screen', 'tty', or 'tv'.153 * Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like 154 * '(orientation: portrait)' and '(max-width: 640px)'. 154 155 */ 155 156 function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) { -
trunk/tests/phpunit/tests/dependencies/styles.php
r36550 r36649 262 262 } 263 263 264 /** 265 * @ticket 35921 266 * @dataProvider data_styles_with_media 267 */ 268 function test_wp_enqueue_style_with_media( $expected, $media ) { 269 wp_enqueue_style( 'handle', 'http://example.com', array(), 1, $media ); 270 $this->assertContains( $expected, get_echo( 'wp_print_styles' ) ); 271 } 272 273 function data_styles_with_media() { 274 return array( 275 array( 276 "media='all'", 277 'all' 278 ), 279 array( 280 "media='(orientation: portrait)'", 281 '(orientation: portrait)' 282 ), 283 array( 284 "media='(max-width: 640px)'", 285 '(max-width: 640px)' 286 ), 287 array( 288 "media='print and (min-width: 25cm)'", 289 'print and (min-width: 25cm)' 290 ), 291 array( 292 "media='screen and (color), projection and (color)'", 293 'screen and (color), projection and (color)' 294 ), 295 array( 296 "media='not screen and (color)'", 297 'not screen and (color)' 298 ), 299 ); 300 } 264 301 }
Note: See TracChangeset
for help on using the changeset viewer.