[wp-hackers] store all revisions of user metadata in wordpress - possible?
Jamie Currie
jamie at wunderdojo.com
Fri Aug 9 21:41:53 UTC 2013
The usermeta table only gives you two fields to work with -- meta_key
and meta_value. So you're not going to be able to do what you want using
that -- how would you know which is the current version of the
meta_value? There isn't any way to say that one of them is the most
recent.
The update_user_meta function simply calls update_metadata
(wp-includes/meta.php -- line 387) which has several action calls you
could hook into. That way you could simply add your own table and update
it each time the user_meta is updated, then pull your historical records
from there.
Jamie Currie
Founder / CEO
wunderdojo
wunderdojo.com <http://www.wunderdojo.com> | twitter.com/wunderdojo
<http://twitter.com/#!/wunderdojo>
tel: 949-734-0758
23 Corporate Plaza Drive, Suite 100
Newport Beach, CA 92660
Master web & app developers
------ Original Message ------
From: "Gregory Lancaster" <greglancaster71 at gmail.com>
To: "wp-hackers at lists.automattic.com" <wp-hackers at lists.automattic.com>
Sent: 8/9/2013 2:36:56 PM
Subject: Re: [wp-hackers] store all revisions of user metadata in
wordpress - possible?
>time stamping it would be ideal, but its something that can maybe be
>added
>later. the primary objective here is to keep a record of all updated
>user
>metadata values. so if someone had the username Benderisgreat and later
>updated it to LisaIsgreat i would have a historical record of both in
>sql
>someplace, which i could then show on their profile page.
>
>
>
>On Friday, August 9, 2013, Jamie Currie wrote:
>
>> If you're referring to entries in the usermeta table, those aren't
>> timestamped so how would you show the changes? Or were you just
>>thinking to
>> show the prior history, not worrying about when a change was made?
>>
>> Jamie Currie
>> Founder / CEO
>> wunderdojo
>> wunderdojo.com <http://www.wunderdojo.com> | twitter.com/wunderdojo <
>> http://twitter.com/#!/**wunderdojo
>><http://twitter.com/#!/wunderdojo>>
>> tel: 949-734-0758
>> 23 Corporate Plaza Drive, Suite 100
>> Newport Beach, CA 92660
>> Master web & app developers
>>
>>
>>
>>
>> ------ Original Message ------
>> From: "Gregory Lancaster" <greglancaster71 at gmail.com>
>> To: wp-hackers at lists.automattic.com
>> Sent: 8/9/2013 2:19:09 PM
>> Subject: [wp-hackers] store all revisions of user metadata in
>>wordpress -
>> possible?
>>
>>> i spend the last seven hours trying to find a to store all revisions
>>>of
>>> *user* metadata. the idea is to allow a user to submit an update via
>>>form,
>>> and maintain a historical record of all previous updates on a
>>>specific
>>> page.
>>>
>>> i have tried auto incrementing the meta_key and meta_id without
>>>success,
>>> as
>>> well as several other strange variations in functions.php. is it
>>>possible
>>> to keep a historical record in this way, and display it visually
>>>along
>>> with
>>> the date each was submitted?
>>> ______________________________**_________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>>
>>>http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>
>>>
>>
>> ______________________________**_________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>>
>>http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>
>>
>_______________________________________________
>wp-hackers mailing list
>wp-hackers at lists.automattic.com
>http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list