Updating Posts Using the Post Management Add-OnPRO

This knowledge base article relates to the WS Form Post Management add-on. Included with the Agency edition or buy separately for other editions.

Tip: We recommend using the templates in the ‘Post Management’ category on the ‘Add New’ page to create your forms. WS Form will automatically add the form fields as well as creating mappings for populating and updating the post data.

Updating a WordPress post using a form is achieved in WS Form using the Post Management add-on. Posts in WordPress represent blog posts, pages or any other custom post you have configured in WordPress.

There are two steps involved when updating a post using WS Form.

WS Form PRO - Post Management - Update a Post

  1. Populate the form with the original post data.
  2. Update the post when the form is submitted.

Choose Which Post to Update

There are three methods you can use to determine which post to update. An explanation of each method and how to configure your form is described below.

Current Post

Use this method if you want to update the post that the form is placed on.

1. Populate the Form

WS Form PRO - Post Management - Populate Form Using Post DataTo populate the form with post data you use the Data tab in the Form Settings sidebar. To do this:

  1. Click the form settings  icon in the top toolbar.
  2. Click on the ‘Data’ tab.
  3. Check the ‘Populate Using Action’ setting.
  4. Choose ‘Post Management’ from the ‘Action To Populate From’ dropdown.
  5. Choose the the post type you would like to populate data from.
  6. Enter #post_id (or leave it blank) to use the Post ID of the post/page the form is shown on.
  7. Use the field mapping, meta mapping and tag mapping settings to determine which fields, meta and tag (WordPress terms) you would like to populate into which fields of your form. Click the ‘Add’  icon to add new mappings.
  8. Click ‘Save’.

2. Update the Post

WS Form PRO - Post Management - Update ActionUpdating the post when the form is submitted is done via the ‘Post Management‘ action. To do this:

  1. When editing your form, click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open.
  2. If you do not yet have a ‘Post Management’ action:
    1. Click the ‘Add’  icon to add a new action.
    2. Choose ‘Post Management’ from the Action pulldown.
  3. Choose the post type you would like to update.
  4. Enter #post_id in the Post ID setting.
  5. Under ‘Status’ we recommend choosing the ‘Default’ setting to retain the existing post status. Otherwise you can choose a specific status for the post.
  6. Use the field mapping and other mapping settings to determine which fields you would like to populate into which fields of your form. Click the ‘Add’  icon to add new mappings.
  7. Click ‘Save’.

Query String Parameter

Use this method if you want to specify the post ID to update in a query string parameter.

For example, the URL to your page might be:

https://yourwebsite.com/page-with-form/?post_id=123

Note that the post ID is specified using the query string at the end of the URL.

post_id=123

So, in this example the post ID to update would be 123 using the query parameter post_id.

1. Populate the Form

WS Form PRO - Post Management - Populate Form Using Post DataTo populate the form with post data you use the Data tab in the Form Settings sidebar. To do this:

  1. Click the form settings  icon in the top toolbar.
  2. Click on the ‘Data’ tab.
  3. Check the ‘Populate Using Action’ setting.
  4. Choose ‘Post Management’ from the ‘Action To Populate From’ dropdown.
  5. Choose the post type of the post you are populating from.
  6. Enter #query_var("post_id") in the Post ID setting.
  7. Use the field mapping, meta mapping and tag mapping settings to determine which fields, meta and tag (WordPress terms) you would like to populate into which fields of your form. Click the ‘Add’  icon to add new mappings.
  8. Click ‘Save’.

2. Update the Post

Updating the post when the form is submitted is done via the ‘Post Management‘ action.

To do this:

WS Form PRO - Post Management - Update Action - Hidden FieldAdd a Hidden Field

A hidden field is required to pass the post ID through to WS Form when the form is submitted.

  1. Add a hidden field to your form.
  2. Set the ‘Default Value’ field setting to #query_var("post_id").

WS Form PRO - Post Management - Update ActionConfigure the Post Management action

  1. When editing your form, click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open.
  2. If you do not yet have a ‘Post Management’ action:
    1. Click the ‘Add’  icon to add a new action.
    2. Choose ‘Post Management’ from the Action pulldown.
  3. Choose the post type you would like to update.
  4. Enter #field(123) in the Post ID setting. Change ‘123’ to the ID of the hidden field you added.
  5. Under ‘Status’ we recommend choosing the ‘Default’ setting to retain the existing post status. Otherwise you can choose a specific status for the post.
  6. Use the field mapping and other mapping settings to determine which fields you would like to populate into which fields of your form. Click the ‘Add’  icon to add new mappings.
  7. Click ‘Save’.

Specific Post ID

Use this method if you want to update a specific post instead of specifying the post ID dynamically.

1. Populate the Form

WS Form PRO - Post Management - Populate Form Using Post DataTo populate the form with post data you use the Data tab in the Form Settings sidebar. To do this:

  1. Click the form settings  icon in the top toolbar.
  2. Click on the ‘Data’ tab.
  3. Check the ‘Populate Using Action’ setting.
  4. Select ‘Post Management’ from the ‘Action To Populate From’ dropdown.
  5. Select the the post type you would like to populate data from.
  6. Enter a post ID (e.g. 123) in the ‘Post ID’ setting.
  7. Use the field mapping, meta mapping and tag mapping settings to determine which fields, meta and tag (WordPress terms) you would like to populate into which fields of your form. Click the ‘Add’  icon to add new mappings.
  8. Click ‘Save’.

2. Update the Post

WS Form PRO - Post Management - Update ActionUpdating the post when the form is submitted is done via the ‘Post Management‘ action. To do this:

  1. When editing your form, click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open.
  2. If you do not yet have a ‘Post Management’ action:
    1. Click the ‘Add’  icon to add a new action.
    2. Select ‘Post Management’ from the Action pulldown.
  3. Select the the post type you would like to update.
  4. Enter a post ID (e.g. 123) in the Post ID setting.
  5. Under ‘Status’ we recommend choosing the ‘Default’ setting to retain the existing post status. Otherwise you can choose a specific status for the post.
  6. Use the field mapping and other mapping settings to determine which fields you would like to populate into which fields of your form. Click the ‘Add’  icon to add new mappings.
  7. Click ‘Save’.

 

Troubleshooting

Form Won’t Populate

  • If your form has been saved, it could be overwriting the populated post data. Clear the session ID. Learn more
  • Ensure you have specified the correct Post ID to populate from. Learn more
  • Ensure all fields are mapped correctly. Learn more

Post Won’t Update

  • Ensure you have specified the correct Post ID to update. Learn more
  • Ensure you have configured the Actions –> Post Management settings to use the correct post ID. See above.
  • Ensure all fields are mapped correctly. Learn more