#50347 closed enhancement (fixed)
is_active_sidebar() documentation is terrible
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Widgets | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
The DocBlock for is_active_sidebar() in wp-includes/widgets.php is terrible, and I spent several hours wondering why mine returned true constantly, even when the sidebar wasn't loaded on the page.
Updated the documentation accordingly, to specify that it returns true if the sidebar contains widgets.
Attachments (1)
Change History (4)
#1
@
5 years ago
- Component changed from General to Widgets
- Keywords has-patch added
- Milestone changed from Awaiting Review to 5.5
- Version trunk deleted
#2
@
5 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 47935:
#3
@
5 years ago
The developer handbook needs to be updated too.
https://developer.wordpress.org/themes/basics/conditional-tags/#is-sidebar-active
Presently, it reads
Check to see if a given sidebar is active (in use). Returns true if the sidebar (identified by name, id, or number) is in use, otherwise the function returns false.
Note: See
TracTickets for help on using
tickets.
Thanks @SUM1 !