#25379 closed enhancement (duplicate)
Add filter hook to modify css selector for _custom_background_cb()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.6 |
| Component: | Themes | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Currently theme's custom background can only be applied to body.custom-background CSS class. This patch adds a filter hook to _custom_background_cb() so theme author can change the CSS selector to apply the custom background to.
Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php (revision 25477)
+++ wp-includes/theme.php (working copy)
@@ -1188,9 +1188,12 @@
$style .= $image . $repeat . $position . $attachment;
}
+
+ $css_selector = apply_filters( 'custom_background_css_selector', 'body.custom-background' );
+
?>
<style type="text/css" id="custom-background-css">
-body.custom-background { <?php echo trim( $style ); ?> }
+<?php echo trim( $css_selector ); ?> { <?php echo trim( $style ); ?> }
</style>
<?php
}
@@ -1750,4 +1753,4 @@
}());
</script>
<?php
-}
\ No newline at end of file
+}
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
patch for wp-include/theme.php