1 | | I uploaded a patch 26386.2.diff that adds the filter I was talking about. Here is example usage: |
2 | | |
3 | | add_filter('custom_background_style', 'slug_full_screen_bg', 10, 2 ); |
4 | | function slug_full_screen_bg( $style, $background ) { |
5 | | if ( $background != '' ) { |
6 | | $style = "background-repeat: no-repeat; -webkit-background-size: cover;-moz-background-size: cover;-o- background-size: cover;background-size: cover;background-attachment:fixed;background-position:center;"; |
7 | | $style .= " background-image: url('$background');"; |
8 | | } |
9 | | return $style; |
10 | | } |
11 | | |
12 | | This example, to be used in a theme or plugin, creates a full-screen background if an image is set in custom backgrounds, and just outputs the background-color rule and value if none is set. |