Saving with Front End Submission

Support MB Frontend Submission Saving with Front End Submission

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31429
    jmcbadejmcbade
    Participant

    Oxygen is installed but I am testing without using Oxygen Templates - just viewing the pages from the page editor.

    1) Using the updated Front End Submission plugin
    2) I want to update these AS the post is either saved or updated
    3) I am using this code to update these two items AS the post is saved

    function update_post_data ( $data ) {
            if ( get_post_type( get_the_ID() ) == 'announcements-cpt' ) {
                $user_object = get_user_by( 'login', 'staff' );
                $data['post_author'] = $user_object->ID;
                $data['post_title'] = $_POST['announcements_title'];
        }
        return $data;
    }
    add_filter( 'wp_insert_post_data', 'update_post_data', 10, 3 );

    It works as expected for posts saved on the Back End but not Front End

    How can I update these two items when using the Front End Submission form?

    #31448
    Long NguyenLong Nguyen
    Moderator

    Hi John,

    You can try to use the frontend form filter rwmb_frontend_insert_post_data to modify the post data, please follow this reply https://support.metabox.io/topic/dashboard-for-logged-in-user/#post-31387
    and the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#post-data-filters

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.