Make WordPress Core

Opened 11 years ago

Closed 8 years ago

Last modified 8 years ago

#24878 closed enhancement (fixed)

is_registered_sidebar()

Reported by: garyj's profile GaryJ Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

is_active_sidebar() looks at whether a sidebar has any widgets in it, but there doesn't seem to be a function that purely checks to see if a sidebar is still registered within the $wp_registered_sidebars global, irrespective of whether it would have any widgets in it or not.

Attachments (2)

24878.diff (897 bytes) - added by GaryJ 11 years ago.
Adds is_registered_sidebar() to compliment register_sidebar() and unregister_sidebar().
24878.2.diff (3.7 KB) - added by wonderboymusic 8 years ago.

Download all attachments as: .zip

Change History (7)

@GaryJ
11 years ago

Adds is_registered_sidebar() to compliment register_sidebar() and unregister_sidebar().

#3 @wonderboymusic
8 years ago

  • Milestone changed from Awaiting Review to 4.4

#4 @wonderboymusic
8 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 35102:

Widgets: add a function, is_registered_sidebar() - helps us avoid touching the $wp_registered_sidebars global.

Props GaryJ, wonderboymusic.
Fixes #24878.

#5 @DrewAPicture
8 years ago

In 35104:

Widgets: Rename the $name parameter in is_registered_sidebar() to $sidebar_id and adjust the accepted types to string|int as sidebar IDs can be numeric.

See #24878.

Note: See TracTickets for help on using tickets.