wp_get_custom_css() – Fetches the saved Custom CSS content for rendering.

You appear to be a bot. Output may be restricted

Description

Fetches the saved Custom CSS content for rendering.

Usage

$string = wp_get_custom_css( $stylesheet );

Parameters

$stylesheet
( string ) optional – Optional. A theme object stylesheet name. Defaults to the active theme.

Returns

string The Custom CSS Post content.

Source

File name: wordpress/wp-includes/theme.php
Lines:

1 to 24 of 24
function wp_get_custom_css( $stylesheet = '' ) {
  $css = '';

  if ( empty( $stylesheet ) ) {
    $stylesheet = get_stylesheet();
  }

  $post = wp_get_custom_css_post( $stylesheet );
  if ( $post ) {
    $css = $post->post_content;
  }

  
/**
 * Filters the custom CSS output into the head element.
 *
 * @since 4.7.0
 *
 * @param string $css        CSS pulled in from the Custom CSS post type.
 * @param string $stylesheet The theme stylesheet name.
 */
  $css = apply_filters( 'wp_get_custom_css', $css, $stylesheet );

  return $css;
}
 

 View on GitHub View on Trac