### [wpforms_post_submissions_process](https://wpforms.com/developers/wpforms_post_submissions_process/)

**Published:** August 14, 2020
**Author:** Editorial Team

**Excerpt:** The wpforms_post_submissions_process action fires during form entry processing, after initial field validation has passed. 

**Content:**

## Description

The `wpforms_post_submissions_process` action fires during form entry processing, after initial field validation has passed.

## Parameters

$post\_id*int (Required)* Post ID.$fields*array* Sanitized entry field values/properties.$form\_data*array* Form settings/data.$entry\_id*int (Required)* Entry ID.## Source

`wpforms-post-submissions/src/Plugin.php`

## More Information

The `wpforms_post_submissions_process` action fires after the fields have been validated, during the entry saving process.

This action will save the entry and begin creating the post from the submission.

## Examples

The example shown below will create some custom meta fields to assign to the post using [WordPress Custom Fields creation](https://www.wpbeginner.com/wp-tutorials/wordpress-custom-fields-101-tips-tricks-and-hacks "WordPress Custom Fields 101: Tips, Tricks, and Hacks").

This example is going to build the social follow links for each author submitted post on the form ID **1159**.

```

/**
 * Action fires after form submission and validation.
 *
 * @link   https://wpforms.com/developers/wpforms_post_submissions_process/
 *
 * @param  int      $post_id     Post ID.
 * @param  array    $fields      Sanitized entry field values/properties.
 * @param  array    $form_data   Form settings/data.
 * @param  int      $entry_id    Entry ID.
 *
 * @return array
 */

function wpf_dev_post_submissions_process( $post_id, $fields, $form_data, $entry_id ) {

    // Only do this for form #1159.
    if ( absint( $form_data[ 'id' ] ) !== 1159 ) {
        return;
    }

    /*
     * Field IDs, for reference.
     * 21 - Twitter URL
     * 22 - Facebook URL
     * 23 - Dribble URL
     * 24 - Instagram URL
     */

    // Below we're going to create our new custom content template,
    // using the field IDs listed above
    ob_start();
    ?&gt;
    &lt;h2&gt;&lt;em&gt;Author Social Follow Links&lt;/em&gt;&lt;/h2&gt;
    &lt;div class=&quot;social_links&quot;&gt;
    &lt;a href=&quot;&lt;?php echo esc_url( $fields[21][ 'value' ] ); ?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;&lt;?php echo get_template_directory_uri(); ?&gt;/images/twitter.png&quot; class=&quot;author_social_follow&quot; width=&quot;80&quot; height=&quot;80&quot; alt=&quot;Follow me on Twitter!&quot; /&gt;&lt;/a&gt;
    &lt;a href=&quot;&lt;?php echo esc_url( $fields[22][ 'value' ] ); ?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;&lt;?php echo get_template_directory_uri(); ?&gt;/images/facebook.png&quot; class=&quot;author_social_follow&quot; width=&quot;80&quot; height=&quot;80&quot; alt=&quot;Follow me on Facebook!&quot; /&gt;&lt;/a&gt;
    &lt;a href=&quot;&lt;?php echo esc_url( $fields[23][ 'value' ] ); ?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;&lt;?php echo get_template_directory_uri(); ?&gt;/images/dribbble.png&quot; class=&quot;author_social_follow&quot; width=&quot;80&quot; height=&quot;80&quot; alt=&quot;Follow me on Dribbble!&quot; /&gt;&lt;/a&gt;
    &lt;a href=&quot;&lt;?php echo esc_url( $fields[24][ 'value' ] ); ?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;&lt;?php echo get_template_directory_uri(); ?&gt;/images/instagram.png&quot; class=&quot;author_social_follow&quot; width=&quot;80&quot; height=&quot;80&quot; alt=&quot;Follow me on Instagram!&quot; /&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;?php
    $content = ob_get_clean();

    remove_filter( 'content_save_pre', 'wp_filter_post_kses' );
    remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );

    $post = array(
        'ID'           =&gt; $post_id,
        'post_content' =&gt; $content,
    );
    wp_update_post( $post );

    add_filter( 'content_save_pre', 'wp_filter_post_kses' );
    add_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
}
add_action( 'wpforms_post_submissions_process', 'wpf_dev_post_submissions_process', 10, 4 );

Reference Articles
```

- [How to Build a Profile Form Using Post Submissions](https://wpforms.com/developers/how-to-build-an-profile-form-using-post-submissions/ "How to Build a Profile Form Using Post Submissions")
- [How to Automatically Assign Tags and Categories to Post Submissions](https://wpforms.com/developers/how-to-automatically-assign-tags-and-categories-to-post-submissions/ "How to Automatically Assign Tags and Categories to Post Submissions")
- [How to Set a Default Featured Image for Post Submissions](https://wpforms.com/developers/how-to-set-a-default-featured-image-for-post-submissions/ "How to Set a Default Featured Image for Post Submissions")

**Categories:** Actions Hooks

**Tags:** PHP

---

