[resolved] Unregister_sidebar (9 posts)

  1. hugw
    Posted 1 year ago #

    When you register only one sidebar on the parent theme, then unregister it on the child theme, the sidebar goes away, but the menu still shows under appearance.

    If i click on the "Widgets" menu the page appears as follow, with the right side entire blank.


    I think this is a bug because the menu needed to go away too.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    If you are referring to a custom menu, that has nothing to do with registered sidebars.

  3. hugw
    Posted 1 year ago #

    Hey Esmi, it is not a custom menu...

    Even when there is no sidebars registered anymore, this menu should disappear, or not?


  4. No, you can use menus in other places. However if you go to the menus it'll tell you that the theme has no menu support.

    This is not a regression, this is how it's worked in 3.7 as well (isn't it?)

  5. hugw
    Posted 1 year ago #

    Hi Mika, this is not about menu support, but sidebars :)

    Take a look at this 2 pictures and you will know about what it's going on.

    With sidebar registered, everthing goes fine: http://d.pr/i/YEAJ
    But, if i unregister it, the menu should disappear, but instead we get a widgets page with no sidebar to drag: http://d.pr/i/hNkB

  6. What happens today on 3.7.1?

  7. ntthai89
    Posted 1 year ago #

    in my opinion: the widgets menu still appear to inform that we have widgets.

  8. I think so too, but it's sort of a question of "Did we break things from 3.7?" or "This is something new we should do differently." :)

  9. Sergey Biryukov
    WordPress Dev
    Posted 1 year ago #

    A workaround is to run this in the child theme after unregistering sidebars:

    unset( $GLOBALS['_wp_theme_features']['widgets'] );

    This was previously addressed in #21761, but we didn't consider child themes unregistering parent sidebars. Feel free to create a new ticket.

Topic Closed

This topic has been closed to new replies.

About this Topic