WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 2 months ago

Last modified 5 weeks ago

#39062 closed enhancement (fixed)

New function: `wp_get_post_revisions_url()`

Reported by: georgestephanis Owned by: hellofromTonya
Milestone: 5.9 Priority: normal
Severity: normal Version: 2.2
Component: Revisions Keywords: has-patch has-unit-tests commit has-dev-note
Focuses: Cc:

Description

There's no good way to get a link to revisions for a given post short of trying to build it manually. Feels like it would be a useful utility function for core.

Patch and unit test attached.

Attachments (2)

39062.diff (2.6 KB) - added by georgestephanis 5 years ago.
39062.1.diff (2.7 KB) - added by audrasjb 4 months ago.
Revisions: Introduce wp_get_post_revisions_url() to get the URL of the revisions screen for a given post.

Download all attachments as: .zip

Change History (23)

#1 @iaaxpage
5 years ago

Hey George, wouldn't this be more of a feature request than a bug?

#2 @georgestephanis
5 years ago

  • Type changed from defect (bug) to enhancement

Arguably. Changed to enhancement.

#4 @adamsilverstein
3 years ago

  • Keywords needs-refresh needs-testing added
  • Milestone set to Future Release
  • Version set to 2.2

This still seems useful, reopening for consideration.

#5 @adamsilverstein
3 years ago

  • Status changed from new to reopened

#6 @adamsilverstein
3 years ago

  • Owner set to adamsilverstein
  • Status changed from reopened to assigned

#7 @adamsilverstein
2 years ago

  • Milestone changed from Future Release to 5.4

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


2 years ago

#9 @davidbaumwald
2 years ago

@adamsilverstein Is this still on your list for 5.4?

#10 @garrett-eclipse
2 years ago

Note: from our bugscrub review this will need a refresh to add @since to the new function and @ticket to the unit test

#11 @davidbaumwald
2 years ago

  • Keywords needs-dev-note added

This ticket still needs a refresh and testing, and with 5.4 Beta 1 landing tomorrow, this is being moved to Future Release. If any maintainer or committer feels this can be included in 5.4 or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

Also marking for a dev note as it at least deserves a small call-out on the Misc Dev Note.

#12 @davidbaumwald
2 years ago

  • Milestone changed from 5.4 to Future Release

#13 @adamsilverstein
2 years ago

I wasn't able to spend time on this for 5.4, I'll get it in early in the next cycle!

@audrasjb
4 months ago

Revisions: Introduce wp_get_post_revisions_url() to get the URL of the revisions screen for a given post.

#14 @audrasjb
4 months ago

  • Keywords needs-refresh needs-testing removed

I agree this would be a nice-to-have.

39062.1.diff refreshes the previous patch against trunk and fixes some issues in the docblock.

The patch works fine on my side.

To test it, simply open your theme's files then go to the template file of your choice and add this line:
<?php echo wp_get_post_revisions_url( get_the_ID() ); ?>
It will display the URL to the revisions screen for the current post.

Moving for 5.9 consideration.

#15 @audrasjb
4 months ago

  • Milestone changed from Future Release to 5.9

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


2 months ago

#17 @hellofromTonya
2 months ago

  • Owner changed from adamsilverstein to hellofromTonya
  • Status changed from assigned to reviewing

This ticket was mentioned in PR #1849 on WordPress/wordpress-develop by costdev.


2 months ago

wp_get_post_revisions_url() gets a link to revisions for a given post.

Trac ticket: https://core.trac.wordpress.org/ticket/39062

#19 @audrasjb
2 months ago

  • Keywords commit added

The PR looks good on my side. Unit tests are passing and look relevant to me.
Marking this for commit consideration.

#20 @hellofromTonya
2 months ago

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

In 52095:

Revisions: Introduce wp_get_post_revisions_url() to get URL for editing revisions.

There's now a way to get a link to a given post's revisions. Introducing wp_get_post_revisions_url() and its unit tests.

Props adamsilverstein, audrasjb, costdev, davidbaumwald, garrett-eclipse, georgestephanis, hellofromTonya, iaaxpage.
Fixes #39062.

Note: See TracTickets for help on using tickets.