Make WordPress Core

Ticket #21627: 21627.diff

File 21627.diff, 848 bytes (added by westonruter, 10 years ago)

Use theme feature attribute instead of filter for selector

  • src/wp-includes/theme.php

    diff --git src/wp-includes/theme.php src/wp-includes/theme.php
    index 9bab1fd..0e33800 100644
    function _custom_background_cb() { 
    13331333
    13341334                $style .= $image . $repeat . $position . $attachment;
    13351335        }
     1336
     1337        $selector = get_theme_support( 'custom-background', 'element-selector' );
    13361338?>
    13371339<style type="text/css" id="custom-background-css">
    1338 body.custom-background { <?php echo trim( $style ); ?> }
     1340<?php echo $selector; ?> { <?php echo trim( $style ); ?> }
    13391341</style>
    13401342<?php
    13411343}
    function add_theme_support( $feature ) { 
    15281530                                'wp-head-callback'       => '_custom_background_cb',
    15291531                                'admin-head-callback'    => '',
    15301532                                'admin-preview-callback' => '',
     1533                                'element-selector'       => 'body.custom-background',
    15311534                        );
    15321535
    15331536                        $jit = isset( $args[0]['__jit'] );