Skip to content

Quick Draft dashboard widget should allow to save drafts with empty Title or Content #79526

Open

Description

@afercia

Description

Follow up to #78408 / #78601
Cc @joedolson for visibility.

Related: https://core.trac.wordpress.org/ticket/64952 for core, which will fix a bug where a draft was saved with both fields empty.

The new Quick Draft dashboard widget (currently under the Gutenberg experiments) requires both Title and Content to be not empty.
That's inconsistent with the current PHP / Ajax widget and more importantly it's inconsistent with how the editor itself works.
It should allow to create a draft with either empty Title or empty Content.

Since forever in WordPress a post with an empty title is perfectly valid.
A post with empty content is valid as well.
Instead, a post with both empty title and empty content is not allowed.

The new widget takes this wrong and should be fixed.

const fields = useMemo< Field< QuickDraftData >[] >(
() => [
{
id: 'title',
type: 'text',
label: __( 'Title' ),
isValid: { required: true, minLength: 3 },
hideLabelFromVision: true,
help: __( 'Enter a title for your post.' ),
},
{
id: 'content',
type: 'text',
label: __( 'Content' ),
isValid: { required: true, minLength: 10 },
Edit: QuickDraftContentField,
help: __( 'Enter the content for your post.' ),
},
],
[]
);

1
The minLength values of 3 and 10 appear to be arbitrary. I don't see a good reason to require a minimum length. There is no reason for them, they should be removed.

2
The two fields should not be both required. They should be conditionally required, as in:

  • A draft with empty title and filled content is valid.
  • A draft with filled title and empty content is valid.
  • A draft with both fields empty is not valid.

As such, the validation for this widget can't be based on the individual fields. It needs some custom validation mechanism that checks whether the other field is empty or not.

Lastly, the values should be trimmed before validation.
Right now, the 'required' and minLength constraints are a bit pointless because the values aren't trimmed.
It is possible to enter multiple spaces and save a draft with, for example, a title made of 1 character and empty content. See video recording:

Screen.Recording.2026-06-25.at.11.24.59.mov

It is worth noting that when a post has an empty title, WordPress uses a fallback title (no title) in its UI (not on the front end).
This default is filterable. Twenty Twenty-One uses the_title filter to change (no title) to Untitled. That's used also in some tests, where the active theme is Twenty Twenty-One.

Step-by-step reproduction instructions

  • Go to the classic dashboard at wp-admin/index.php
  • Use the Quick Draft widget.
  • Leave the title empty.
  • Enter some content.
  • Submit and observe the draft is created.
  • Same when filling in the Title and leaving the Content empty.
  • Go to wp-admin/post-new.php to create a new draft post.
  • Observe you can save a draft with en empty title or an empty content.
  • Enable the Dashboard experiment on WP Admin > Gutenberg > experiments
  • Go to the new Dashboard.
  • Try to save a Quick Draft with empty title or empty content.
  • Observe the widget requires both fields to be filled in.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] Bug
    [Feature] Dashboard
    on Jun 25, 2026
  2. changed the title [-]Quick Draft dashboard widget[/-] [+]Quick Draft dashboard widget should allow to save drafts with empty Title or Content[/+] on Jun 25, 2026
  3. added
    [Status] In Progress
    on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Feature] Dashboard[Status] In Progress[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions