Make WordPress Core

Opened 18 years ago

Closed 16 years ago

#4594 closed enhancement (fixed)

Widgets API to check for active sidebars

Reported by: filosofo's profile filosofo Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.3
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

There should be a way to check if particular sidebar is in use, because a theme developer might want to change the markup in the presence of a sidebar actually being used.

My patch adds a "is_active_sidebar" function, to which one can pass a sidebar name, id, or number to return a boolean value reflecting whether that sidebar is actually in use.

Attachments (1)

is_active_sidebar_api.diff (641 bytes) - added by filosofo 18 years ago.

Download all attachments as: .zip

Change History (8)

#1 @foolswisdom
18 years ago

  • Milestone changed from 2.3 to 2.4 (next)

#2 @foolswisdom
18 years ago

  • Keywords has-patch added

#3 @ffemtcj
17 years ago

  • Milestone changed from 2.5 to 2.6

#4 @filosofo
17 years ago

The patch is still good, and the idea, helpful, in my opinion. Having an API to figure out active sidebars is better than forcing theme creators to parse the global widget variables.

#5 @ryan
16 years ago

  • Component changed from Administration to Widgets
  • Owner anonymous deleted

#6 @Denis-de-Bernardy
16 years ago

  • Keywords widgets sidebar api removed
  • Milestone changed from 2.9 to 2.8

see also #9511 and #5759

#7 @azaozz
16 years ago

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

(In [11134]) Add is_active_sidebar(), props filosofo, fixes #4594

Note: See TracTickets for help on using tickets.