get_background_color() WordPress Function

The get_background_color() function is used to retrieve the background color of an element. The function takes one parameter, which is the element's ID. The function returns the background color of the element as a string.

get_background_color() #

Retrieves value for custom background color.


Return

(string)


Top ↑

Source

File: wp-includes/theme.php

function get_background_color() {
	return get_theme_mod( 'background_color', get_theme_support( 'custom-background', 'default-color' ) );
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More