Make WordPress Core

Opened 16 months ago

Closed 7 months ago

Last modified 7 months ago

#57704 closed enhancement (fixed)

Add revisions to the links of the template and template part REST endpoint

Reported by: andraganescu's profile andraganescu Owned by:
Milestone: 6.4 Priority: normal
Severity: minor Version:
Component: REST API Keywords: needs-patch
Focuses: Cc:


Because templates and template parts are just custom post types we already have revisions saved for them. Being able to access and use the revisions screen for templates and template parts in block themes therefore seems a low hanging fruit enhancement.

In a first step to use this available feature has been taken - to simply display a button that sends the user to the revisions management screen.

To be able to achieve this, however, the API requires a decoration of the template controller with links that hold the revision count and previous revision, because of this bug in

To port this change to core we need to bring this decoration over, either via a solution similar to the one merged in Gutenberg or via the solution explored in

Change History (14)

#1 @flixos90
16 months ago

@andraganescu Is this necessary for 6.2? Since the Gutenberg PR was merged just 5 days ago and we are past the beta cut off for enhancements, I am not sure it's a good idea to introduce significant REST API changes at this point; particularly as even that Gutenberg code was marked as experimental.

I would suggest to move this to the 6.3 milestone for consideration. cc @hellofromTonya

#2 @andraganescu
16 months ago

  • Priority changed from high to normal
  • Severity changed from normal to minor

Hi @flixos90,

A problem I have is in the Gutenberg PR a bug was uncovered in the REST API - so it depends on how we look at it - is it an enhancement of the editor brought by offering that button to users, or is it also a bug fix in the template rest API endpoints?

It is not a must have, it is definitely a nice to have in 6.2, nothing will break if this does not land. On the other hand it is such a low hanging fruit enhancement, received with such positive feedback, that we may want to try and see if it is possible to land it in 6.2.

It is clear that if we can add the proper bug fix to the REST API in 6.2, either by porting the PHP solution in the Gutenberg PR or by implementing a more thorough fix as seen in, the porting of the code to show the button is pretty harmless even as we're past the cutoff for enhancements.

I will say that I fully understand a decision to skip for multiple reasons:

  • I may not have a full understanding of scope of updates in the REST API
  • I am about to open a ticket about that Gutenberg PR itself, which only adds even more work (the links in the revisions editor don't go back to the editor)
  • It's only a nice to have :)

Yet, it is possible and nice to have :)

#3 @andraganescu
16 months ago

  • Milestone changed from 6.2 to 6.3

With #57709 moved to 6.3 due to having to deal with a new shape of edit links in WP admin, this should also move to the next release.

#4 @oandregal
12 months ago

@draganescu I was looking at doing the backport for for 6.3, which essentially merged Gutenberg_REST_Template_Revision_Count into Gutenberg_REST_Templates_Controller_6_3. Gutenberg_REST_Template_Revision_Count was introduced by which this ticket aims to backport.

Looking at this, my understanding is that it was blocked by two things:

I'm out of my expertise here, so may have a uncalibrated intuition, though it sounds like this is not ready for 6.3, is that correct?

It sounds to me that the next steps are:

#5 @andraganescu
12 months ago

@oandregal I am not sure, I think @spacedmonkey and/or @TimothyBlynJacobs should weigh in here.

#6 @spacedmonkey
12 months ago

I believe that this ticket is blocked by #56922. #56922 has been worked on in a while and need more to get into core.

Willing to review anymore that come in for #56922.

This ticket was mentioned in Slack in #core by chaion07. View the logs.

11 months ago

#8 @chaion07
11 months ago

  • Milestone changed from 6.3 to Future Release

Thanks @andraganescu for reporting this. We reviewed this ticket during a recent bug-scrub session have decided to move it to Future Release due to #56922 blocker. Cheers!

Props to @oglekler & @audrasjb

#9 @hellofromTonya
10 months ago

  • Milestone changed from Future Release to 6.4

I moved #56922 into the 6.4 milestone for visibility and to hopefully wrangle some folks to possibility get it moving forward in time to ship in 6.4.

Moving this ticket into the milestone too. Once #56922 gets unblocked and committed, then this ticket can move forward too.

#10 @kafleg
9 months ago

I'm looking for this feature as I faced issue while working on my personal blog. As there is no revision feature, I had to restore backup from my hosting.

#11 @oglekler
9 months ago

  • Milestone changed from 6.4 to 6.5

I forced to disappoint everyone who is waiting for this to be resolved, there is no patch and no time before Beta 1 to make and test one, so, I am moving this ticket into the 6.5 milestone.

#12 @spacedmonkey
8 months ago

@andraganescu Now that #56922 is committed, what is needed for this ticket? Seems to be working in my testing.

#13 @andraganescu
7 months ago

  • Resolution set to fixed
  • Status changed from new to closed

I believe this ticket can be close. Thank you for the work enabling this!

#14 @ironprogrammer
7 months ago

  • Milestone changed from 6.5 to 6.4

Moving back into the 6.4 milestone for clarity of when this was addressed (i.e. via #56922).

Note: See TracTickets for help on using tickets.