Support

Account

Home Forums Front-end Issues _edit_last not being updated on when using frontend

Solving

_edit_last not being updated on when using frontend

  • Last Author Edited by is not being updated when using frontend forms.
    It seems i have all required things in the page for it to work. Even repeater fields with media files are working ok including frontend javascript. Having used it in production with more than 40 fields of all types this is so far the only problem i’ve found regarding the front-end form.

    This works normally when using the backend. In our case this is a critical function. Is this a bug or anything specific i should be looking at?

    i have…

    
    <?php acf_form_head(); ?>
    <?php get_header(); ?>
    
    ...
    
    acf_form(array('id'=>'my_frontend_form_id','label_placement' => 'left'))
    
    ...
    
    <?php acf_enqueue_uploader(); ?>
    <?php get_footer(); ?>
    

    I saw another post about revisions not being created when using frontend forms. Maybe its related to that?

  • It could be related to the revision thing. If a revision isn’t being saved then is there a place to record who made the change?

    You might want to submit a new support ticket https://support.advancedcustomfields.com/forums/topic/_edit_last-not-being-updated-on-when-using-frontend/

    You might also want to look into adding an acf/save_post filter and make this update yourself if it’s required.

  • Hi John, thanks for replying.
    Not sure how to submit a new support ticket. The link takes me back here again.
    Saving _edit_last should be the expected behavior in my opinion.

    I’ll try anyways to dig in the issue and use the acf/save_post filter.

  • That’s the second time in a week I gave a link back to the topic I was posting on instead of the support ticket link. Seems I’m loosing my mind or something. The correct link is https://support.advancedcustomfields.com/new-ticket/. This link also appears in at the top of the page when starting a new topic

    Please note that forum topics are no longer used as support tickets. Instead, please open a support ticket

  • I just did some more checking on this topic for another one _edit_last is not something that ACF updates when editing a post using acf_form()…. I posted some more information here https://support.advancedcustomfields.com/forums/topic/updatechange-modified-author/

  • This is working for me, it updates the last modified author when editing from the front end.

    Just add this to your functions file.

    
    function user_acf_save_post( $post_id )
    {
    update_post_meta( $post_id, '_edit_last', get_current_user_id() );//update last modified by
    }
    
    // run after save post
    add_action('save_post', 'user_acf_save_post', 10);
    
    
Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘_edit_last not being updated on when using frontend’ is closed to new replies.