WP_Styles::print_inline_style( string $handle, bool $display = true )
Prints extra CSS styles of a registered stylesheet.
Parameters
- $handle
-
(Required) The style's registered handle.
- $display
-
(Optional) Whether to print the inline style instead of just returning it.
Default value: true
Return
(string|bool) False if no data exists, inline styles if $display
is true, true otherwise.
Source
File: wp-includes/class-wp-styles.php
public function print_inline_style( $handle, $echo = true ) {
$output = $this->get_data( $handle, 'after' );
if ( empty( $output ) ) {
return false;
}
$output = implode( "\n", $output );
if ( ! $echo ) {
return $output;
}
printf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $output );
return true;
}
Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |