Show a custom widget area through $_GET ?
-
Hi.
I’ve added a link (similar to edit-post-link) that links to wp-admin/widgets.php after my sidebar areas so my customers easily can find where to edit widgets when looking at their site.
This works fine but I would love to be able to open/highlight the sidebar they clicked the link from.
Right now all widget areas are closed except the first. This is default and looking at widgets.php there’s no way to change this since it’s a loop that adds the class “closed” after the first widget area.
line: 376
if ( $i ) $wrap_class .= ' closed'; ?>
Since $i is 1/true as soon as it’s passed the first run ‘ closed’ is always added to the $wrap_class.
A suggestion would be to just check for “opened” in $registered_sidebar[‘class’] and then not add ” closed” to the $wrap_class.
This would let developers choose to force_open their sidebars as default or check for something like $_GET[‘open_sidebar’]==$sidebar[‘id’] to add ‘opened’ to their registered_sidebar class on the fly.
- The topic ‘Show a custom widget area through $_GET ?’ is closed to new replies.