~canonical-sysadmins/wordpress/4.9.4

« back to all changes in this revision

Viewing changes to wp-includes/class.wp-styles.php

  • Committer: Barry Price
  • Date: 2017-11-17 04:49:02 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: barry.price@canonical.com-20171117044902-5frux4ycbq6g9fyf
Merge WP4.9 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
/**
12
12
 * Core class used to register styles.
13
13
 *
14
 
 * @package WordPress
15
 
 * @uses WP_Dependencies
16
14
 * @since 2.6.0
 
15
 *
 
16
 * @see WP_Dependencies
17
17
 */
18
18
class WP_Styles extends WP_Dependencies {
19
19
        /**
22
22
         * Full URL with trailing slash.
23
23
         *
24
24
         * @since 2.6.0
25
 
         * @access public
26
25
         * @var string
27
26
         */
28
27
        public $base_url;
31
30
         * URL of the content directory.
32
31
         *
33
32
         * @since 2.8.0
34
 
         * @access public
35
33
         * @var string
36
34
         */
37
35
        public $content_url;
40
38
         * Default version string for stylesheets.
41
39
         *
42
40
         * @since 2.6.0
43
 
         * @access public
44
41
         * @var string
45
42
         */
46
43
        public $default_version;
49
46
         * The current text direction.
50
47
         *
51
48
         * @since 2.6.0
52
 
         * @access public
53
49
         * @var string
54
50
         */
55
51
        public $text_direction = 'ltr';
58
54
         * Holds a list of style handles which will be concatenated.
59
55
         *
60
56
         * @since 2.8.0
61
 
         * @access public
62
57
         * @var string
63
58
         */
64
59
        public $concat = '';
68
63
         *
69
64
         * @since 2.8.0
70
65
         * @deprecated 3.4.0
71
 
         * @access public
72
66
         * @var string
73
67
         */
74
68
        public $concat_version = '';
77
71
         * Whether to perform concatenation.
78
72
         *
79
73
         * @since 2.8.0
80
 
         * @access public
81
74
         * @var bool
82
75
         */
83
76
        public $do_concat = false;
87
80
         * is enabled.
88
81
         *
89
82
         * @since 2.8.0
90
 
         * @access public
91
83
         * @var string
92
84
         */
93
85
        public $print_html = '';
96
88
         * Holds inline styles if concatenation is enabled.
97
89
         *
98
90
         * @since 3.3.0
99
 
         * @access public
100
91
         * @var string
101
92
         */
102
93
        public $print_code = '';
105
96
         * List of default directories.
106
97
         *
107
98
         * @since 2.8.0
108
 
         * @access public
109
99
         * @var array
110
100
         */
111
101
        public $default_dirs;
114
104
         * Constructor.
115
105
         *
116
106
         * @since 2.6.0
117
 
         * @access public
118
107
         */
119
108
        public function __construct() {
120
109
                /**
122
111
                 *
123
112
                 * @since 2.6.0
124
113
                 *
125
 
                 * @param WP_Styles &$this WP_Styles instance, passed by reference.
 
114
                 * @param WP_Styles $this WP_Styles instance (passed by reference).
126
115
                 */
127
116
                do_action_ref_array( 'wp_default_styles', array(&$this) );
128
117
        }
131
120
         * Processes a style dependency.
132
121
         *
133
122
         * @since 2.6.0
134
 
         * @access public
135
123
         *
136
124
         * @see WP_Dependencies::do_item()
137
125
         *
246
234
         * Adds extra CSS styles to a registered stylesheet.
247
235
         *
248
236
         * @since 3.3.0
249
 
         * @access public
250
237
         *
251
238
         * @param string $handle The style's registered handle.
252
239
         * @param string $code   String containing the CSS styles to be added.
271
258
         * Prints extra CSS styles of a registered stylesheet.
272
259
         *
273
260
         * @since 3.3.0
274
 
         * @access public
275
261
         *
276
262
         * @param string $handle The style's registered handle.
277
263
         * @param bool   $echo   Optional. Whether to echo the inline style instead of just returning it.
300
286
         * Determines style dependencies.
301
287
         *
302
288
         * @since 2.6.0
303
 
         * @access public
304
289
         *
305
290
         * @see WP_Dependencies::all_deps()
306
291
         *
328
313
         * Generates an enqueued style's fully-qualified URL.
329
314
         *
330
315
         * @since 2.6.0
331
 
         * @access public
332
316
         *
333
317
         * @param string $src The source of the enqueued style.
334
318
         * @param string $ver The version of the enqueued style.
359
343
         * Whether a handle's source is in a default directory.
360
344
         *
361
345
         * @since 2.8.0
362
 
         * @access public
363
346
         *
364
347
         * @param string $src The source of the enqueued style.
365
348
         * @return bool True if found, false if not.
381
364
         * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
382
365
         *
383
366
         * @since 3.3.0
384
 
         * @access public
385
367
         *
386
368
         * @see WP_Dependencies::do_items()
387
369
         *
396
378
         * Resets class properties.
397
379
         *
398
380
         * @since 3.3.0
399
 
         * @access public
400
381
         */
401
382
        public function reset() {
402
383
                $this->do_concat = false;