Make WordPress Core

Ticket #51656: wp-body-class-dark-mode.patch

File wp-body-class-dark-mode.patch, 1.6 KB (added by mpol, 4 years ago)

Patch that adds theme support for dark themes with a body-class.

  • src/wp-includes/post-template.php

     
    785785                $classes[] = 'wp-embed-responsive';
    786786        }
    787787
     788        if ( current_theme_supports( 'dark-theme' ) ) {
     789                $classes[] = 'wp-dark-theme';
     790        }
     791
    788792        $page = $wp_query->get( 'page' );
    789793
    790794        if ( ! $page || $page < 2 ) {
  • src/wp-includes/theme.php

     
    24822482 * @since 5.5.0 The `core-block-patterns` feature was added and is enabled by default.
    24832483 * @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'.
    24842484 * @since 5.6.0 The `post-formats` feature warns if no array is passed.
     2485 * @since 5.7.0 The `dark-theme` feature was added.
    24852486 *
    24862487 * @global array $_wp_theme_features
    24872488 *
     
    24902491 *                        'html5', 'title-tag', 'customize-selective-refresh-widgets', 'starter-content',
    24912492 *                        'responsive-embeds', 'align-wide', 'dark-editor-style', 'disable-custom-colors',
    24922493 *                        'disable-custom-font-sizes', 'editor-color-palette', 'editor-font-sizes',
    2493  *                        'editor-styles', 'wp-block-styles', and 'core-block-patterns'.
     2494 *                        'editor-styles', 'wp-block-styles', 'core-block-patterns', and 'dark-theme'.
    24942495 * @param mixed  ...$args Optional extra arguments to pass along with certain features.
    24952496 * @return void|bool False on failure, void otherwise.
    24962497 */