WordPress.org

Make WordPress Core

Opened 13 months ago

Last modified 10 months ago

#40577 new enhancement

Introduce a capability for viewing the revisions of a post

Reported by: johnbillion Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.6
Component: Revisions Keywords: needs-unit-tests granular-capabilities needs-patch
Focuses: administration, rest-api Cc:

Description

In order to view the revisions of a post, a user needs the ability to edit the post. This makes sense because it may be undesirable for users to be able to view older revisions of a post which they cannot edit.

However it may be desirable to allow certain users to view the revisions of a post which they cannot edit, for example for auditing purposes, or to allow contributors to browse the revisions of their own published post.

Attachments (1)

40577.diff (812 bytes) - added by adamsilverstein 10 months ago.

Download all attachments as: .zip

Change History (7)

#1 @Stagger Lee
13 months ago

Hi,

It could be usable when building custom classifieds, or similar. To show revisions history of one custom field, say price field.

#2 @johnbillion
10 months ago

  • Keywords granular-capabilities added

#3 @adamsilverstein
10 months ago

@johnbillion - were you thinking something like 40577.diff? I added read_revision for $revision->ID and read_revisions for $revision->post_parent. Not sure this is enough to get what you were suggesting. If so, we need some unit tests to validate the behavior.

#4 @adamsilverstein
10 months ago

  • Keywords has-patch reporter-feedback added; needs-patch removed

#5 follow-up: @johnbillion
10 months ago

  • Keywords needs-patch added; has-patch reporter-feedback removed

The required change is actually quite a lot more complex than that. I have a patch in progress.

#6 in reply to: ↑ 5 @adamsilverstein
10 months ago

Replying to johnbillion:

The required change is actually quite a lot more complex than that. I have a patch in progress.

Great! Looking forward to seeing and learning from your patch.

Note: See TracTickets for help on using tickets.