get_stylesheet(): string
Retrieves name of the current stylesheet.
Description
The theme name that is currently set as the front end theme.
For all intents and purposes, the template name and the stylesheet name are going to be the same for most cases.
Return
string Stylesheet name.
Source
File: wp-includes/theme.php
.
View all references
function get_stylesheet() {
/**
* Filters the name of current stylesheet.
*
* @since 1.5.0
*
* @param string $stylesheet Name of the current stylesheet.
*/
return apply_filters( 'stylesheet', get_option( 'stylesheet' ) );
}
Hooks
-
apply_filters( 'stylesheet',
string $stylesheet ) -
Filters the name of current stylesheet.
Related
Uses
Uses | Description |
---|---|
apply_filters() wp-includes/plugin.php |
Calls the callback functions that have been added to a filter hook. |
get_option() wp-includes/option.php |
Retrieves an option value based on an option name. |
Used By
Used By | Description |
---|---|
_register_theme_block_patterns() wp-includes/block-patterns.php |
Register any patterns that the active theme may provide under its |
WP_REST_Global_Styles_Controller::get_theme_items() wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php |
Returns the given theme global styles variations. |
WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles() wp-includes/class-wp-theme-json-resolver.php |
Returns the custom post type that contains the user’s origin config for the active theme or a void array if none are found. |
WP_REST_Global_Styles_Controller::get_theme_item() wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php |
Returns the given theme global styles config. |
WP_REST_Edit_Site_Export_Controller::export() wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php |
Output a ZIP file with an export of the current templates and template parts from the site editor, and close the connection. |
wp_set_unique_slug_on_create_template_part() wp-includes/theme-templates.php |
Sets a custom slug when creating auto-draft template parts. |
wp_generate_block_templates_export_file() wp-includes/block-template-utils.php |
Creates an export of the current templates and template parts from the site editor at the specified path in a ZIP file. |
get_block_file_template() wp-includes/block-template-utils.php |
Retrieves a unified template object based on a theme file. |
block_template_part() wp-includes/block-template-utils.php |
Prints a block template part. |
_inject_theme_attribute_in_block_template_content() wp-includes/block-template-utils.php |
Parses wp_template content and injects the active theme’s stylesheet as a theme attribute into each wp_template_part |
_build_block_template_result_from_file() wp-includes/block-template-utils.php |
Builds a unified template object based on a theme file. |
_build_block_template_result_from_post() wp-includes/block-template-utils.php |
Builds a unified template object based a post Object. |
_get_block_template_file() wp-includes/block-template-utils.php |
Retrieves the template file from the theme for a given slug. |
_get_block_templates_files() wp-includes/block-template-utils.php |
Retrieves the template files from the theme. |
get_block_theme_folders() wp-includes/block-template-utils.php |
For backward compatibility reasons, block themes might be using block-templates or block-template-parts, this function ensures we fallback to these folders properly. |
WP_REST_Templates_Controller::prepare_item_for_database() wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php |
Prepares a single template for create or update. |
wp_filter_wp_template_unique_post_slug() wp-includes/theme-templates.php |
Generates a unique slug for templates. |
resolve_block_template() wp-includes/block-template.php |
Returns the correct ‘wp_template’ to render for the request template type. |
get_block_templates() wp-includes/block-template-utils.php |
Retrieves a list of unified template objects based on a query. |
is_theme_paused() wp-admin/includes/theme.php |
Determines whether a theme is technically active but was paused while loading. |
wp_edit_theme_plugin_file() wp-admin/includes/file.php |
Attempts to edit a file for a theme or plugin. |
wp_update_custom_css_post() wp-includes/theme.php |
Updates the |
wp_get_custom_css_post() wp-includes/theme.php |
Fetches the |
wp_get_custom_css() wp-includes/theme.php |
Fetches the saved Custom CSS content for rendering. |
Custom_Background::ajax_background_add() wp-admin/includes/class-custom-background.php |
Handles Ajax request for adding custom background context to an attachment. |
Theme_Upgrader::current_before() wp-admin/includes/class-theme-upgrader.php |
Turn on maintenance mode before attempting to upgrade the active theme. |
Theme_Upgrader::current_after() wp-admin/includes/class-theme-upgrader.php |
Turn off maintenance mode after upgrading the active theme. |
Theme_Upgrader::bulk_upgrade() wp-admin/includes/class-theme-upgrader.php |
Upgrade several themes at once. |
wp_prepare_themes_for_js() wp-admin/includes/theme.php |
Prepares themes for JavaScript. |
Theme_Upgrader_Skin::after() wp-admin/includes/class-theme-upgrader-skin.php |
Action to perform following a single theme update. |
Custom_Image_Header::ajax_header_add() wp-admin/includes/class-custom-image-header.php |
Given an attachment ID for a header image, updates its “last used” timestamp to now. |
Custom_Image_Header::ajax_header_remove() wp-admin/includes/class-custom-image-header.php |
Given an attachment ID for a header image, unsets it as a user-uploaded header image for the active theme. |
Custom_Image_Header::customize_set_last_used() wp-admin/includes/class-custom-image-header.php |
Updates the last-used postmeta on a header image attachment after saving a new header image via the Customizer. |
Custom_Image_Header::get_uploaded_header_images() wp-admin/includes/class-custom-image-header.php |
Gets the previously uploaded header images. |
Custom_Image_Header::set_header_image() wp-admin/includes/class-custom-image-header.php |
Choose a header image, selected from existing uploaded and default headers, or provide an array of uploaded header data (either new, or from media library). |
WP_Customize_Manager::register_controls() wp-includes/class-wp-customize-manager.php |
Registers some default controls. |
WP_Customize_Manager::__construct() wp-includes/class-wp-customize-manager.php |
Constructor. |
validate_current_theme() wp-includes/theme.php |
Checks that the active theme has the required files. |
get_stylesheet_directory() wp-includes/theme.php |
Retrieves stylesheet directory path for the active theme. |
get_stylesheet_directory_uri() wp-includes/theme.php |
Retrieves stylesheet directory URI for the active theme. |
wp_get_themes() wp-includes/theme.php |
Returns an array of WP_Theme objects based on the arguments. |
wp_get_theme() wp-includes/theme.php |
Gets a WP_Theme object for a theme. |
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |