Skip to content

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

Closed

Description

@skorasaurus

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)?

Activity

  1. added
    [Type] Enhancement
    [Feature] Widgets Screen
    [Feature] Widgets Customizer
    on Jul 16, 2021
  2. noisysocks commented on Feb 4, 2022

    @noisysocks
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Widgets Customizer[Feature] Widgets Screen[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions