WordPress.org

Ready to get started?Download WordPress

Forums

Widget Context
0.8.1 Returning incorrect "true" for "is_active_sidebar()" and " (8 posts)

  1. Tristan Rineer
    Member
    Posted 1 year ago #

    Both the is_active_sidebar and is_dynamic_sidebar functions are returning true on pages with no widgets.

    As a developer who implements designs with "collapsing" widget areas that disappear when empty and allow the site to restructure, getting an incorrect "true" means broken site layouts due to "empty" sidebars appearing in places where they are not wanted.

    I found a temporary solution that required using an object to check if the sidebar has content, but that breaks non-static widgets such as: widgets with javascript and/or widgets that contain positions of their own for tabbed content/etc.

    http://wordpress.org/extend/plugins/widget-context/

  2. Gene
    Member
    Posted 1 year ago #

    Tristan,

    Here's a fork of 0.8.1 that provides a fix for this.

    You could comment about it on the pull request. I'd be interested to hear if it works for you also.

  3. Tristan Rineer
    Member
    Posted 1 year ago #

    Gene,

    Thanks for the quick solution. It works perfectly.

    I've been wanting to create my own widget management solution so I wouldn't have to rely on a "third party" option, for this specific reason (potential bugs); it's good to see that a bugfix was found so fast.

    Afterthought:
    Do we know when the fix might be merged into the main release? I've got clients that update their own sites and an "official" update would solve a lot of support issues.

    I'm going to leave this as "unresolved" until an official update that fixes it, just because it's technically not resolved until that happens.

  4. Gene
    Member
    Posted 1 year ago #

    Do we know when the fix might be merged into the main release?

    Hard to say. Definitely unresolved. I'm hoping if there's support for the pull request it'll bring some attention to the issue.

  5. Tristan Rineer
    Member
    Posted 1 year ago #

    Since the pull request is yours, do you mind responding here with an update if/when it's accepted?

    I'm referring people to this thread when they ask me about the problem so they can make the choice to implement your fix on their own or just watch for the update.

  6. Gene
    Member
    Posted 1 year ago #

    Sure. Kaspars was making the rounds here a week ago. I bet we'll hear from him soon.

  7. Gene
    Member
    Posted 1 year ago #

    My pull request was merged. Anybody wanting the quick fix for this issue should look to the master branch rather than my fork.

  8. ralphonz
    Member
    Posted 1 year ago #

    Phew! Thanks guys.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.