Definition:
function wp_add_inline_style( $handle, $data ) {}
Adds extra CSS.
Works only if the stylesheet has already been added. Accepts a string $data containing the CSS. If two or more CSS code blocks are added to the same stylesheet $handle, they will be printed in the order they were added, i.e. the latter added styles can redeclare the previous.
Parameters
- $handle
- $data
Source code
function wp_add_inline_style( $handle, $data ) { global $wp_styles; if ( ! is_a( $wp_styles, 'WP_Styles' ) ) { if ( ! did_action( 'init' ) ) _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' ); $wp_styles = new WP_Styles(); } return $wp_styles->add_inline_style( $handle, $data ); }
17393
No comments yet... Be the first to leave a reply!