WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

#48846 closed defect (bug) (duplicate)

Revision meta box is hidden when one revision

Reported by: ecairol Owned by:
Milestone: Priority: normal
Severity: minor Version: 5.3
Component: Revisions Keywords:
Focuses: Cc:

Description

When editing a post, if there's only 1 revision associated with the post, the meta box will be hidden. The cause of this is the condition being > instead of >=

On file: wp-admin/includes/meta-boxes.php

<?php
// We should aim to show the revisions meta box only when there are revisions.
if ( count( $revisions ) > 1 ) {

If the aim is to show the box when there are revisions, even one, then the condition should have been $revisions >= 1.

If you set your wp-config to store only 1 single revision per post, the meta-box won't display.

I read the first step is opening this ticket, however I'm more than happy to open a PR with a fix.

Change History (1)

#1 @SergeyBiryukov
8 months ago

  • Component changed from Editor to Revisions
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #26577.

Note: See TracTickets for help on using tickets.