Opened 16 years ago
Closed 9 years ago
#9681 closed feature request (fixed)
Add hooks to allow a plugin to support the deletion of unneeded revisions
Reported by: | Denis-de-Bernardy | Owned by: | adamsilverstein |
---|---|---|---|
Milestone: | 4.4 | Priority: | low |
Severity: | minor | Version: | 2.8 |
Component: | Revisions | Keywords: | has-patch |
Focuses: | Cc: |
Description
There currently is a means to restore a revision, but no means to delete one.
Attachments (5)
Change History (36)
#2
@
16 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 2.8
#3
follow-up:
↓ 4
@
16 years ago
- Milestone changed from 2.8 to Future Release
The original intention was to leave all revision-management to a plugin, to let the community decide and develop what was needed, and to eventually integrate the best one out there with Core.
Revision management is something thats needed, But I'm not sure just implementing the delete functionality is a good idea.
I'm moving this to a Future release, Mearly based upon the idea that adding something full blown should be done instead (And its a feature request) - Of course, A committer could come along in a minute and commit it anyway..
That aside, Comments on the patch: Just because revisions are disabled, doesnt mean to say that revisions shouldnt be deleted.
#4
in reply to:
↑ 3
;
follow-up:
↓ 9
@
16 years ago
Replying to DD32:
That aside, Comments on the patch: Just because revisions are disabled, doesnt mean to say that revisions shouldnt be deleted.
same for restoring a revision?
#5
@
16 years ago
Some other thought: If you wanna do that by Plugin with a plugable interface: fine (very fine). But that means a change for the restoring action as well. This Patch really is small and oriented to the existing code, so that I do not really see a problem to have it in and to replace it in a further release with a better thought concept.
+1 for having the small patch in for now.
#7
follow-up:
↓ 8
@
16 years ago
- Keywords dev-feedback added
same for restoring a revision?
Nah, Revisions are disabled, therefor, let them restore any that for some reason, are available.
I think i included a delete option on Revision Control (WP Plugin of mine) - It needs a rewrite, I was planning on something with a better fledged UI.. havnt gotten around to it.
I guess you're right, a minimal patch would be ok, might kick others into making more plugins or suggestions.
I hate to say it, but i do think it has to wait for 2.9, I hate having to draw a line in the sand between which enhancements should be added after a near-feature-freeze (But i dont think we're there yet officially?)
#8
in reply to:
↑ 7
@
16 years ago
Replying to DD32:
I hate to say it, but i do think it has to wait for 2.9, I hate having to draw a line in the sand between which enhancements should be added after a near-feature-freeze (But i dont think we're there yet officially?)
dev blog said we were a few weeks back. and then loads of features got tossed in, so...
personally, I'd rather see 2.8 get released in july with all known bugs closed, or nearly so, rather than rushed next month to meet an artificial deadline.
#9
in reply to:
↑ 4
@
16 years ago
Replying to DD32:
same for restoring a revision?
Nah, Revisions are disabled, therefor, let them restore any that for some reason, are available.
just aside comment to the patch: delete action has taken over the same checks then revert action. if you do like to have the revert action available if revisions are disabled, then the trunk must be patched for that. i have just taken over the same piece of code for deleting than it is available for reverting.
#13
@
16 years ago
- Keywords dev-feedback removed
still applies clean. would be nice if this got committed or rejected before it's stale.
#14
@
15 years ago
- Keywords needs-patch added; has-patch tested removed
This is broken as is.
I get notices for undefined vars on delete - h2 and right_checked
There is not user-experience feedback on the action.
#15
follow-up:
↓ 16
@
15 years ago
@westi:
Do you not get notices for undefined vars on restore?
Do you not get a user-experience feddback on the restore-action?
#16
in reply to:
↑ 15
@
15 years ago
Replying to hakre:
@westi:
Do you not get notices for undefined vars on restore?
Nope
Do you not get a user-experience feddback on the restore-action?
Yes - it redirects back to the post edit page and you get a message at the top.
e.g. - Post restored to revision from 20 December, 2005 @ 10:50
#17
@
15 years ago
- Keywords has-patch added; needs-patch removed
I updated the patch, it now gives feedback to the user that and which revision has been deleted.
there should be no warnings about undefined variables.
#18
follow-up:
↓ 19
@
15 years ago
Deleting revisions has some security/management implications for multi-user blogs. It breaks the audit trail. Don't think we need any support for that in core even if it doesn't have an UI.
If another hook is needed to allow plugins to implement it easier, lets add it.
#19
in reply to:
↑ 18
@
15 years ago
- Keywords needs-patch added; has-patch removed
- Milestone changed from 2.9 to Future Release
- Summary changed from Add a button to allow the deletion of unneeded revisions to Add hooks to allow a plugin to support the deletion of unneeded revisions
Replying to azaozz:
Deleting revisions has some security/management implications for multi-user blogs. It breaks the audit trail. Don't think we need any support for that in core even if it doesn't have an UI.
If another hook is needed to allow plugins to implement it easier, lets add it.
Agreed.
If someone wants to cook up a patch for wp_list_post_revisions() to add the required hooks and put together a demo plugin to test with then I will happily commit the required hooks.
Moving to Future for now until that patch exists.
#20
@
15 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 3.0
#21
@
15 years ago
Not sure the current patch will enable all of it to happen easily in a plugin.
Do we not need a hook in revision.php to make it easy to implement delete?
Also I'm not sure we have an easy obvious hook for handling unknown message ids?
#22
@
15 years ago
- Keywords need-patch added; has-patch removed
k... I guess this'll wait for a better patch then, and a sample plugin.
#24
@
12 years ago
- Keywords revisions-3.6 added
Adding to the list to consider for the 3.6 revisions work.
#27
@
9 years ago
- Keywords has-patch dev-feedback added; need-patch removed
- Owner set to adamsilverstein
- Status changed from new to assigned
In [attachement:9681.2.diff]:
- Add a filter for the actions available in the revisions list meta box (currently none).
This allows plugin authors to add links to end of each line in the revisions list meta box. Although we hide this meta box by default, some users may still prefer this overview of their revisions and want a way to add management features. This hook adds that capability and can be used to resolve the original issue raised in this ticket.
I created a simple plugin demonstrating how this hook can be used : https://github.com/adamsilverstein/wp-post-revision-delete-action
With this patch in place and the plugin active, the meta revisions list gets new Delete options:
After deleting the revision, the user sees a confirmation message and revision is gone:
#28
@
9 years ago
- Keywords needs-patch added; has-patch dev-feedback removed
- Milestone changed from Future Release to 4.4
These are not my favorite types of hooks to add, but let's figure out where exactly to put this and what to name it (it's not just actions, and the placement is a little awkward) and get it done.
#29
@
9 years ago
9681.3.diff is a potential option.
#30
@
9 years ago
- Keywords has-patch added; needs-patch removed
@helen In 9681.3.diff, let's wrap the function name in the description for the $link
parameter to a new line and remove the backticks. Otherwise, I like this placement a lot better.
Looks like this was only forgotten, there was a message called stub in the code and most functionaly already provided with the restore action.