[wp-hackers] Autosave API for custom post types?

Sinan yok2504 at gmail.com
Wed Mar 5 17:45:52 UTC 2014


Nice  !
So version control coming for custom fields. Cool !


2014-03-05 19:40 GMT+02:00 TV productions <info at tv-productions.org>:

> Thanks Pascal! I am going to dig into ticket 20564.
> That small tutorial is very nice, I used it to make my revisions work. The
> problem is really the autosave. When you restore an autosave now, all the
> meta data is lost.
>
> ~Ties
>
>
> ---
> TV productions :: Web development and stuff
> http://tv-productions.org
>
> On 05-03-2014 16:33, Pascal Birchler wrote:
>
>> Currently WP doesn't store revisions of post meta data, but there are
>> plans
>> to do this. See this ticket: https://core.trac.wordpress.org/ticket/20564
>>
>> John Blackbourn has written a small tutorial to make it work with a
>> plugin,
>> too: https://johnblackbourn.com/post-meta-revisions-wordpress
>>
>>
>> 2014-03-05 0:02 GMT+01:00 TV productions <info at tv-productions.org>:
>>
>> Andrew,
>>
>> I believe it does so, but it doesn't submit the whole post form.
>>
>> This is the post data that a typical autosave request has (after the title
>> has changed)
>> ==================================
>> action          autosave
>> autosave        true
>> autosavenonce   ebb79c8859
>> catslist
>> comment_status  open
>> content
>> excerpt
>> ping_status     open
>> post_author     1
>> post_id         2996
>> post_name       a
>> post_title      Ab
>> post_type       easy-photo-album
>> ==================================
>> I hope my problem is a bit more clear now.
>>
>> Ties
>>
>> ---
>>
>> TV productions :: Web development and stuff
>> http://tv-productions.org
>>
>> On 04-03-2014 23:57, Andrew Bartel wrote:
>>
>> Does autosave not trigger the save_post and/or edit_post actions?  You
>> could probably hook on to those.
>>
>> -Andrew
>>
>>
>> On Tue, Mar 4, 2014 at 2:50 PM, TV productions <info at tv-productions.org>
>> wrote:
>>
>> Hi wp-hackers,
>>
>> I have a plugin (http://wordpress.org/plugins/easy-photo-album/) with a
>> custom post type and as update I've added successfully support for
>> revisions. But when I restore an autosave, the metadata (that is saved
>> with
>> the revisions) is empty. After digging into the code, I found out that
>> autosave only checks the title and the content (which in my plugin doesn't
>> exists on the edit page) for differences and saves only them.
>>
>> So I was wondering if there is (or will be in the near future) a autosave
>> API that allows to save also "custom data". And, if that is not the case,
>> does anyone know a workaround to save my metadata with autosave?
>>
>> Best regards,
>>
>> Ties
>>
>> --
>> TV productions :: Web development and stuff
>> http://tv-productions.org
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> 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
>>
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> 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
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Sinan İŞLER
sinanisler.com <http://www.sinanisler.com/>


More information about the wp-hackers mailing list