[wp-trac] [WordPress Trac] #29790: Widgets don't know the widget area context they're in
WordPress Trac
noreply at wordpress.org
Mon Oct 6 20:06:28 UTC 2014
#29790: Widgets don't know the widget area context they're in
-------------------------------------+-------------------------------------
Reporter: ruud@… | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Widgets | Version: trunk
Severity: normal | Resolution:
Keywords: dev-feedback needs- | Focuses: accessibility,
patch | administration
-------------------------------------+-------------------------------------
Comment (by westonruter):
Replying to [comment:13 ruud@…]:
> How about dropping 'sidebar' in favor of 'widget-area'? What's the
general verdict on this?
>
> get_widget_area_context();
> set_widget_area_context();
While “sidebar” has been replaced with “widget area” in the user-facing
admin pages, the term “sidebar” is still used exclusively in the WordPress
API, so I think it should be used here too.
{{{
class WP_Widget {
/* ... */
public function get_sidebar_id() {
foreach ( wp_get_sidebars_widgets() as $sidebar_id =>
$widgets_ids ) {
if ( in_array( $this->id, $widgets_ids ) ) {
return $sidebar_id;
}
}
return null;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29790#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list