Additional column in revison log?

18 views
Skip to first unread message

dkowalski

unread,
Jun 11, 2012, 12:01:48 PM6/11/12
to wp-documen...@googlegroups.com
First of all, thanks a lot for the time and effort you put into this plugin!

We want to track release numbers of a document in a separate column within the Revision Log.
Currently we add them to the summary-column, but for a cleaner layout it would be great to move this
data into its own column. Is this possible?

Thanks a lot for help.

Daniel Kowalski

Benjamin J. Balter

unread,
Jun 11, 2012, 6:08:49 PM6/11/12
to wp-documen...@googlegroups.com
Interesting thought. So for background, each document has two unique numeric identifiers. First, each revision is given an index number, thus the first upload is 1, the second upload is 2, etc. You can see this by looking at the URL of any of the timestamp links in the log. e.g., my-file-revision-1.txt.

Each revision also has a unique post_id. So the first upload may be 100 but if you post a bunch of other stuff in the middle there, the subsequent revision may be 125. (Technically, there's also an attachment ID distinct from the revision ID, but introducing that will just complicate things).

Just a matter of which you want to use. The first, you pass the revision ID to the function $wpdr->get_revision_number( $revision->ID ), the second would be simply $revision->ID.

Looking at the code, there's not easy way to simply splice in another column into the revision log. There's no API hook there. You could deregister the metabox, copy the code, add your column, and register your own which would just swap out a custom metabox for the default one in the plugin, without actually changing the plugin itself.

Rewriting the revision metabox to behave a bit more like wp_list_table where you could register another column heading + callback would be also be an option, and more than glad to accept a pull request on GitHub.

- Ben


--
You received this message because you are subscribed to the Google Groups "WP Document Revisions" group.
To view this discussion on the web visit https://groups.google.com/d/msg/wp-document-revisions/-/lj6RdAFaB-YJ.
To post to this group, send email to wp-documen...@googlegroups.com.
To unsubscribe from this group, send email to wp-document-revi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wp-document-revisions?hl=en.

Reply all
Reply to author
Forward
0 new messages