Make WordPress Core

Opened 7 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#65530 closed enhancement (fixed)

Improve classic editor Publish box visibility controls layout

Reported by: poligilad Owned by: joedolson
Priority: normal Milestone: 7.1
Component: Editor Version:
Severity: normal Keywords: has-patch has-screenshots commit
Cc: Focuses: ui, accessibility

Description

The classic editor Publish box currently presents the Visibility controls as three radio options: Public, Password protected, and Private. When Password protected is selected, the password field appears inline within that group. The Sticky checkbox is also conditionally shown for public posts.

This works functionally, but the layout makes the visibility choices and their related secondary controls harder to scan. The password field is a conditional setting for the Password protected option, rather than a visibility option itself, and it can make the radio group feel visually uneven.

This ticket proposes a small markup/layout improvement for the classic editor Publish box:

  • Keep the existing Visibility radio choices:
    • Public
    • Password protected
    • Private
  • When Password protected is selected, show the password input below the radio group.
  • Keep “Stick this post to the front page” as a checkbox, shown only when Public is selected and sticky posts are supported.
  • Preserve the existing save contract using visibility=public|password|private.
  • Preserve existing OK/Cancel behavior:
    • OK updates the Visibility summary.
    • Cancel restores the previous visibility, password, and sticky state.
  • Avoid changing post status behavior or the underlying meaning of public/password/private/private visibility.

This is intended as a small, incremental improvement to the classic editor Publish box that makes related Visibility controls easier to scan, moves the UI slightly closer to the block editor’s explicit Visibility choices, and preserves the existing workflow and save behavior.

Related:

  • #7745 discusses long-standing Status/Visibility coupling and includes older publish box UI explorations, but this ticket is narrower and does not attempt to change private post status behavior.
  • #25459 addressed accessibility improvements in the Publish box.
  • #24792 touched the password-protected visibility password field.
  • #47153 provides broader admin form control accessibility context.

Attachments (1)

Visibility.png (771.4 KB ) - added by poligilad 7 weeks ago.

Download all attachments as: .zip

Change History (11)

@poligilad
7 weeks ago

This ticket was mentioned in PR #12298 on WordPress/wordpress-develop by @poligilad.


7 weeks ago
#1

  • Keywords has-patch has-unit-tests added

## Summary

  • Groups the classic editor Publish box Visibility radio options in a fieldset.
  • Moves the conditional password field below the radio group while preserving the existing visibility save values.
  • Keeps the Sticky checkbox as a conditional secondary control and adds focused layout coverage.

## Context
This is intended as a small, incremental improvement to the classic editor Publish box that makes related Visibility controls easier to scan, moves the UI slightly closer to the block editor's explicit Visibility choices, and preserves the existing workflow and save behavior.

This PR does not change post status behavior or the meaning of public, password protected, or private visibility. The save path continues to use the existing visibility=public|password|private values.

Related tickets:

  • #7745 discusses the longer-standing Status/Visibility coupling for private posts. This PR is narrower and does not attempt to change private post status behavior.
  • #25459 addressed accessibility improvements in the Publish box.
  • #24792 touched the password-protected visibility password field.
  • #47153 provides broader admin form control accessibility context.

## Testing

  • npm run test:php -- --filter Tests_Admin_IncludesMetaBoxes tests/phpunit/tests/admin/includesMetaBoxes.php
  • php -l src/wp-admin/includes/meta-boxes.php
  • php -l tests/phpunit/tests/admin/includesMetaBoxes.php
  • node --check src/js/_enqueues/admin/post.js
  • git diff --check

#2 @tyxla
6 weeks ago

Thanks for working on this @poligilad!

I mostly have a couple of concerns:

  • The classic editor Publish box is long-standing, maintenance-mode surface. The order and structure of these fields is something a lot of plugins/themes hook into, so re-ordering the DOM carries real backward-compat risk that we should justify.
  • The conditional field positioning was intentional: Sticky was under Public and the Password field under Password protected, each directly below the radio it relates to. The new layout puts the conditional controls in the opposite order from their radios. This seems off.

@poligilad commented on PR #12298:


6 weeks ago
#3

Thank you @tyxla!

Updated the approach based on your review feedback.

The PR no longer changes the Publish box markup, moves the password field, or adds a markup-focused PHPUnit test. It now keeps the existing DOM order and behavior, and limits the change to CSS spacing/alignment for the secondary Visibility controls.

The goal is to make the UI cleaner and reinforce that Sticky belongs to Public, and the password field belongs to Password protected, without changing the existing save behavior or visibility=public|password|private values.

@fcoveram commented on PR #12298:


6 weeks ago
#4

This looks good to me 🚀

@poligilad commented on PR #12298:


6 weeks ago
#5

Thanks @tyxla!

Addressed everything, looks more polished! I checked on mobile too, looks good 👌

#6 @joedolson
6 weeks ago

  • Milestone Awaiting Review7.1
  • Owner set to joedolson
  • Status newaccepted

If we're going to do #65532, it only makes sense to address both of these.

#7 @joedolson
6 weeks ago

  • Keywords has-screenshots commit added; has-unit-tests removed

#8 follow-up: @joedolson
6 weeks ago

  • Resolutionfixed
  • Status acceptedclosed

In 62605:

Editor: Improve spacing and alignment of visibility controls.

Adds vertical spacing for visibility sub-controls and aligns the element border to the text line to decrease visual complexity.

Props poligilad, tuzla, fcoveram, joedolson.
Fixes #65530.

#9 in reply to: ↑ 8 @poligilad
6 weeks ago

Thank you @joedolson!

#10 @tyxla
6 weeks ago

Thanks for landing it, @joedolson!

Note: See TracTickets for help on using tickets.