[wp-trac] [WordPress Trac] #25379: Add filter hook to modify css selector for _custom_background_cb()

WordPress Trac noreply at wordpress.org
Sun Sep 22 04:55:44 UTC 2013


#25379: Add filter hook to modify css selector for _custom_background_cb()
-----------------------------+-----------------------------
 Reporter:  miyauchi         |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:  trunk
 Severity:  normal           |   Keywords:  has-patch
-----------------------------+-----------------------------
 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
 +}
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25379>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list