[buddypress-trac] [BuddyPress] #2751: Add function around widgets in functions.php
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Sun Nov 21 11:30:22 UTC 2010
#2751: Add function around widgets in functions.php
-------------------------+--------------------------------------------------
Reporter: karmatosed | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 1.3
Component: Theme | Version:
Keywords: |
-------------------------+--------------------------------------------------
My suggestion is to wrap widgets in function to work better for child
themes knowing when widgets are registered. It will also allow for ease
of un registering.
Something along the lines of this....
{{{
function default_widgets_init() {
register_sidebar( array(
'name' => 'Sidebar',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
) );
register_sidebar( array(
'name' => __( 'First Footer Widget Area', 'buddypress' ),
'id' => 'first-footer-widget-area',
'description' => __( 'The first footer widget area', 'buddypress'
),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => '</li>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>',
) );
... other widgets
}
add_action( 'widgets_init', 'default_widgets_init' );
}}}
--
Ticket URL: <http://trac.buddypress.org/ticket/2751>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list