mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-12 06:43:20 +01:00
Themes: Add wp-theme-<name>
and wp-child-theme-<name>
classes to body_class
.
This changeset introduces new classes to the body tag. The classes `wp-theme-<name>` and `wp-child-theme-<name>` (when the current theme is a child theme) are added, where `<name>` represents the sanitized name of the active theme. Props cais, GaryJ, nacin, SergeyBiryukov, johnjamesjacoby, nirajgirixd, poena, audrasjb, rinkalpagdar. Fixes #19736. Built from https://develop.svn.wordpress.org/trunk@59698 git-svn-id: http://core.svn.wordpress.org/trunk@59040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9b1fa5c2d6
commit
4de28b054d
@ -214,6 +214,11 @@ if ( $current_screen->is_block_editor() ) {
|
||||
$admin_body_class .= ' block-editor-page wp-embed-responsive';
|
||||
}
|
||||
|
||||
$admin_body_class .= ' wp-theme-' . sanitize_html_class( get_template() );
|
||||
if ( is_child_theme() ) {
|
||||
$admin_body_class .= ' wp-child-theme-' . sanitize_html_class( get_stylesheet() );
|
||||
}
|
||||
|
||||
$error_get_last = error_get_last();
|
||||
|
||||
// Print a CSS class to make PHP errors visible.
|
||||
|
@ -838,6 +838,11 @@ function get_body_class( $css_class = '' ) {
|
||||
}
|
||||
}
|
||||
|
||||
$classes[] = 'wp-theme-' . sanitize_html_class( get_template() );
|
||||
if ( is_child_theme() ) {
|
||||
$classes[] = 'wp-child-theme-' . sanitize_html_class( get_stylesheet() );
|
||||
}
|
||||
|
||||
if ( ! empty( $css_class ) ) {
|
||||
if ( ! is_array( $css_class ) ) {
|
||||
$css_class = preg_split( '#\s+#', $css_class );
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-alpha-59697';
|
||||
$wp_version = '6.8-alpha-59698';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user