[wp-trac] [WordPress Trac] #21834: Comment History
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 7 20:47:19 UTC 2012
#21834: Comment History
-------------------------+------------------------------
Reporter: mattoperry | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version:
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+------------------------------
Comment (by nacin):
Nice!
For some background, this was the project that the grist.org guys took on
at the WCSF hack day. They are sadly not pictured
[http://make.wordpress.org/core/2012/08/15/roundup-wordcamp-san-francisco-
hack-day/ here], as there were another 20-something people sitting off
camera to the right.
I think we can do better than Akismet's current method of storing an
internationalized string in the DB. The problem is, once this happens, we
can't do anything else with that data, especially since
internationalization makes it non-parseable (and forces the history to be
stored in whatever language the user is using, which may change even user
to user).
I think the best way to do this would be to utilize a message identifier,
and an array of arguments. This is basically already happening with
'time', 'event' (using the action name — clever!), and 'user' (which
should probably be a user ID, rather than a login). But since we have all
of the data, we can avoid storing a message at all, and instead render it
on runtime.
Props to Andy Skelton for putting this idea in my head a long while ago.
The more fleshed out idea is each item is its own callback function with
arguments — and then you simply call the callback function with the
specified arguments on render. Works great for activity streams, etc. In
this case, we can probably keep it to being simple message IDs (well, hook
names) with a switch() statement.
(Also, you caught me; I do muse often. Though, [comment:ticket:9495:3]
looks like a typo'd reference.)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21834#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list