equal
deleted
inserted
replaced
101 public $default_dirs; |
101 public $default_dirs; |
102 |
102 |
103 /** |
103 /** |
104 * Holds a string which contains the type attribute for style tag. |
104 * Holds a string which contains the type attribute for style tag. |
105 * |
105 * |
106 * If the current theme does not declare HTML5 support for 'style', |
106 * If the active theme does not declare HTML5 support for 'style', |
107 * then it initializes as `type='text/css'`. |
107 * then it initializes as `type='text/css'`. |
108 * |
108 * |
109 * @since 5.3.0 |
109 * @since 5.3.0 |
110 * @var string |
110 * @var string |
111 */ |
111 */ |
128 /** |
128 /** |
129 * Fires when the WP_Styles instance is initialized. |
129 * Fires when the WP_Styles instance is initialized. |
130 * |
130 * |
131 * @since 2.6.0 |
131 * @since 2.6.0 |
132 * |
132 * |
133 * @param WP_Styles $this WP_Styles instance (passed by reference). |
133 * @param WP_Styles $wp_styles WP_Styles instance (passed by reference). |
134 */ |
134 */ |
135 do_action_ref_array( 'wp_default_styles', array( &$this ) ); |
135 do_action_ref_array( 'wp_default_styles', array( &$this ) ); |
136 } |
136 } |
137 |
137 |
138 /** |
138 /** |
322 /** |
322 /** |
323 * Prints extra CSS styles of a registered stylesheet. |
323 * Prints extra CSS styles of a registered stylesheet. |
324 * |
324 * |
325 * @since 3.3.0 |
325 * @since 3.3.0 |
326 * |
326 * |
327 * @param string $handle The style's registered handle. |
327 * @param string $handle The style's registered handle. |
328 * @param bool $echo Optional. Whether to echo the inline style |
328 * @param bool $display Optional. Whether to print the inline style |
329 * instead of just returning it. Default true. |
329 * instead of just returning it. Default true. |
330 * @return string|bool False if no data exists, inline styles if `$echo` is true, |
330 * @return string|bool False if no data exists, inline styles if `$display` is true, |
331 * true otherwise. |
331 * true otherwise. |
332 */ |
332 */ |
333 public function print_inline_style( $handle, $echo = true ) { |
333 public function print_inline_style( $handle, $display = true ) { |
334 $output = $this->get_data( $handle, 'after' ); |
334 $output = $this->get_data( $handle, 'after' ); |
335 |
335 |
336 if ( empty( $output ) ) { |
336 if ( empty( $output ) ) { |
337 return false; |
337 return false; |
338 } |
338 } |
339 |
339 |
340 $output = implode( "\n", $output ); |
340 $output = implode( "\n", $output ); |
341 |
341 |
342 if ( ! $echo ) { |
342 if ( ! $display ) { |
343 return $output; |
343 return $output; |
344 } |
344 } |
345 |
345 |
346 printf( |
346 printf( |
347 "<style id='%s-inline-css'%s>\n%s\n</style>\n", |
347 "<style id='%s-inline-css'%s>\n%s\n</style>\n", |