WordPress.org

Make WordPress Core

Ticket #26386: 26386.2.diff

File 26386.2.diff, 744 bytes (added by Shelob9, 8 years ago)

Adds a filter to _custom_background_cb() to override $style

  • wp-includes/theme.php

    diff --git a/wp-includes/theme.php b/wp-includes/theme.php
    index 0ae8a8b..d3d5a60 100644
    a b function _custom_background_cb() { 
    12971297
    12981298                $style .= $image . $repeat . $position . $attachment;
    12991299        }
    1300 ?>
     1300
     1301    /**
     1302     * Filter CSS for custom background
     1303     *
     1304     * Override the styles for the custom background set in the custom background admin page or customizer.
     1305     *
     1306     * @since 3.9.0
     1307     *
     1308     * @param string $style CSS to output in head
     1309     */
     1310    $style = apply_filters( 'custom_background_style', $style, $background  );
     1311    ?>
    13011312<style type="text/css" id="custom-background-css">
    13021313body.custom-background { <?php echo trim( $style ); ?> }
    13031314</style>