Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Rename widget areas to "sidebar-1" and "sidebar-2" #481

Closed
ocean90 opened this issue Sep 23, 2019 · 3 comments · Fixed by #556
Closed

Rename widget areas to "sidebar-1" and "sidebar-2" #481

ocean90 opened this issue Sep 23, 2019 · 3 comments · Fixed by #556

Comments

@ocean90
Copy link
Member

ocean90 commented Sep 23, 2019

twentytwenty/functions.php

Lines 331 to 353 in bbfc370

// Footer #1.
register_sidebar(
array_merge(
$shared_args,
array(
'name' => __( 'Footer #1', 'twentytwenty' ),
'id' => 'footer-one',
'description' => __( 'Widgets in this area will be displayed in the first column in the footer.', 'twentytwenty' ),
)
)
);
// Footer #2.
register_sidebar(
array_merge(
$shared_args,
array(
'name' => __( 'Footer #2', 'twentytwenty' ),
'id' => 'footer-two',
'description' => __( 'Widgets in this area will be displayed in the second column in the footer.', 'twentytwenty' ),
)
)
);

When switching themes, WordPress tries to map previous widget areas to the new theme, see wp_map_sidebars_widgets(). Unfortunately, the current naming ("footer-one" and "footer-two") are preventing this.

@joyously
Copy link

We discussed this before. There is a mapping for "footer", so that should work. I don't think it should be named sidebar if it's not on the side.

pento pushed a commit to WordPress/wordpress-develop that referenced this issue Sep 23, 2019
This ensures that widgets are mapped correctly and is consistent with the previous default themes.

See WordPress/twentytwenty#481.

Reverts [46282].

Props ocean90, garrett-eclipse, desrosj, SergeyBiryukov.
See #48110.

git-svn-id: https://develop.svn.wordpress.org/trunk@46283 602fd350-edb4-49c9-b593-d223f7449a82
nylen pushed a commit to nylen/wordpress-develop-svn that referenced this issue Sep 23, 2019
This ensures that widgets are mapped correctly and is consistent with the previous default themes.

See WordPress/twentytwenty#481.

Reverts [46282].

Props ocean90, garrett-eclipse, desrosj, SergeyBiryukov.
See #48110.

git-svn-id: https://develop.svn.wordpress.org/trunk@46283 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this issue Sep 23, 2019
This ensures that widgets are mapped correctly and is consistent with the previous default themes.

See WordPress/twentytwenty#481.

Reverts [46282].

Props ocean90, garrett-eclipse, desrosj, SergeyBiryukov.
See #48110.
Built from https://develop.svn.wordpress.org/trunk@46283


git-svn-id: http://core.svn.wordpress.org/trunk@46095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this issue Sep 23, 2019
This ensures that widgets are mapped correctly and is consistent with the previous default themes.

See WordPress/twentytwenty#481.

Reverts [46282].

Props ocean90, garrett-eclipse, desrosj, SergeyBiryukov.
See #48110.
Built from https://develop.svn.wordpress.org/trunk@46283


git-svn-id: https://core.svn.wordpress.org/trunk@46095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@pattonwebz
Copy link
Member

In testing this there are quite a lot of themes that contain footer-one but there are a lot more themes that have sidebar-1 as their names.

Personally I feel like the semantics of labelling as the footer areas could be handled by the labels - with names mapped to whatever is deemed most appropriate.

@pattonwebz pattonwebz added this to To do in Beta 2 Sep 24, 2019
@pattonwebz
Copy link
Member

OK so after looking at this and doing various searches on the existing directory I found that the best option is to swap the ids of the menus to be sidebar-1 and sidebar-2.

This is based mostly on the numbers of themes that utilise these exact names. Firstly for core themes there are several million installs where they sync but this pair is also the most common in non-core themes as well.

Some general match numbers on basic searches:
Screenshot from 2019-09-26 14-23-50

('|")(sidebar-1|sidebar-2)('|")
('|")(footer-one|footer-two)('|")

@pattonwebz pattonwebz moved this from To do to Done in Beta 2 Sep 26, 2019
miya0001 pushed a commit to cjk4wp/wordpress that referenced this issue Oct 26, 2019
This ensures that widgets are mapped correctly and is consistent with the previous default themes.

See WordPress/twentytwenty#481.

Reverts [46282].

Props ocean90, garrett-eclipse, desrosj, SergeyBiryukov.
See #48110.

git-svn-id: http://develop.svn.wordpress.org/trunk@46283 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Beta 2
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants