Home Forums Plugin Support WP User Frontend Pro Help With Saving Draft Feature

This topic is: resolved

This topic contains 10 replies, has 3 voices, and was last updated by  Tareq Hasan 6 years, 1 month ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #3949

    btf122
    Participant
    Post count: 11

    Tareq, I am having trouble getting the save draft feature to work. I submitted a post earlier today describing my problem. When I try to save a post as a draft in the front end before submitting it, and then go back to edit it, only the title and category are saved – the body of my post is not saved. Please let me know how to fix this problem.

    Thanks.

    #3951

    Tareq Hasan
    Keymaster
    Post count: 2831

    You don't have to create same topics to catch attention.

    If you site is live, can I have a look? Post the details as private reply.

    #3955

    btf122
    Participant
    Post count: 11
    This reply has been marked as private.
    #3956

    Tareq Hasan
    Keymaster
    Post count: 2831

    Seems like I overlooked the rich textarea when doing the draft post feature, it needs some special care to grab the contents from rich textarea.

    You've to add this JavaScript code to the /js/frontend-form.js, after line 57. This will fix the problem.
    [js]
    var rich_texts = [], temp, val;

    // grab rich texts from tinyMCE
    $(‘.wpuf-rich-validation').each(function (index, item) {
    temp = $(item).data(‘id');
    val = $.trim( tinyMCE.get(temp).getContent() );

    rich_texts.push(temp + ‘=' + encodeURIComponent( val ) );
    });

    // append them to the form var
    form_data = form_data + ‘&' + rich_texts.join(‘&');
    [/js]

    #3957

    btf122
    Participant
    Post count: 11

    Ok I will give that code a try. Thanks for your help once again Tareq.

    #3996

    paperweight
    Participant
    Post count: 122

    Hi tareq: quick question about updates and the code above. How do you notify paid users of updates to the plugin and how often do you add updates? And when you do update it will contain code above right?

    #3997

    Tareq Hasan
    Keymaster
    Post count: 2831

    The plugin gets update as you get updates to the free plugins. You know them by the standard plugin/theme/wp update notification. License key is required to get plugin updates obviously.

    See the changelog and the dates. Today I pushed an update with some fixes, but can't remember if I've included this in the update or not ๐Ÿ˜†

    #4001

    btf122
    Participant
    Post count: 11
    This reply has been marked as private.
    #4002

    Tareq Hasan
    Keymaster
    Post count: 2831

    may be the placement is wrong, see this:

    [js]
    var self = $(this),
    form = $(this).closest(‘form'),
    form_data = form.serialize() + ‘&action=wpuf_draft_post',
    post_id = form.find(‘input[type="hidden"][name="post_id"]').val();

    var rich_texts = []
    temp, val;

    // grab rich texts from tinyMCE
    $(‘.wpuf-rich-validation').each(function (index, item) {
    temp = $(item).data(‘id');
    val = $.trim( tinyMCE.get(temp).getContent() );

    rich_texts.push(temp + ‘=' + encodeURIComponent( val ) );
    });

    // append them to the form var
    form_data = form_data + ‘&' + rich_texts.join(‘&');

    self.after(‘ <span class="wpuf-loading"></span>');
    [/js]

    #4004

    btf122
    Participant
    Post count: 11

    I tried that spacing as well and I still can't seem to get it to work.

    #4011

    Tareq Hasan
    Keymaster
    Post count: 2831

    I tested it and it works. So make sure you put that code in right place and clear your browser cache.

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Help With Saving Draft Feature’ is closed to new replies.