Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the Code editor within the Widget Customizer/Screen #33518

Closed
skorasaurus opened this issue Jul 16, 2021 · 1 comment
Closed

Enable the Code editor within the Widget Customizer/Screen #33518

skorasaurus opened this issue Jul 16, 2021 · 1 comment
Labels
[Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Enhancement A suggestion for improvement.

Comments

@skorasaurus
Copy link
Member

skorasaurus commented Jul 16, 2021

To create a consistent editing experience with the rest of the block editor, the widget editor/customizer should also have the code editor.

I occasionally will copy content from one page to another by going into the code editor (on a particular page); copying the relevant markup/html and then copying it into a new page or area of my site.
(I hope to do less of this as templates and patterns becoming easier to make; but neither are enabled to be inserted into widget customizer screen yet ; ref #26170).

I did this workflow again because I wanted to reproduce one of our reusable blocks in the block-based widgets but that's since that's not currently possible (ref #32952) and didn't want to go through the motions of recreating the block(s) and setting their options.

Step-by-step reproduction instructions

  1. visit path-to-your-site.test/wp-admin/widgets.php
  2. select a widget area

Expected behaviour

have the code editor option available when a widget area was selected

Actual behaviour

WordPress information

  • WordPress version: 5.8-RC3
  • Gutenberg version: 11.0.0
  • Are all plugins except Gutenberg deactivated? n/a
  • Are you using a default theme (e.g. Twenty Twenty-One)?
@skorasaurus skorasaurus added [Type] Enhancement A suggestion for improvement. [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. labels Jul 16, 2021
@noisysocks
Copy link
Member

Thanks for the request.

We have a similar predicament in the widgets editor to what @noahtallen describes in #22528 (comment) about the site editor. Unlike the post editor, there is no single entity which we can display the HTML code for. Instead the widgets screen displays multiple widget area entities.

Put simply, the Code Editor would just show this:

<!-- wp:widget-area { "id": "header-1" } /-->
<!-- wp:widget-area { "id": "sidebar-1" } /-->

Which isn't very useful!

It might be something that we can implement in the future, particularly if we move away from showing multiple widget areas in the single screen. See also #33254.

I'll close this issue out as "won't fix" for now but will leave note in #33254 as yet another argument for moving away from the current approach involving Widget Area blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants