Option ManagementPRO

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

WordPress options are a core feature of WordPress that allow developers to store and retrieve site-wide settings in the database using the wp_options table. These options are commonly used for saving configuration settings, theme preferences, plugin data, and other customizable values that persist across pages and sessions.

The WS Form Option Management add-on lets you set WordPress options and also populate form fields with option values.

WS Form - Option Management

Custom Field Plugin Support

While WordPress provides built-in functions like get_option() and update_option() to manage these settings, developers often rely on tools like Advanced Custom Fields (ACF), JetEngine or Meta Box to create more user-friendly settings pages. These plugins provide interfaces for managing custom options, making it easier for site administrators to configure settings without writing custom code.

The WS Form Option Management allows developers to seamlessly retrieve and populate form fields with stored option values without the need for using WordPress functions. Furthermore, the add-on can be used to populate and set any option name with an option value, including using WS Form variables.

The following custom field plugins are also supported by the Option Management add-on:

WS Form can automatically create option forms for these custom field plugins.

Installation

The Option Management plugin is installed in the same way as installing the WS Form PRO plugin.

Once installed you will need to activate the license for the plugin. When you purchase the Option Management plugin, you will be given a license key. If you have lost your license key(s), click here.

To activate your license key:

  1. Click WS Form in the WordPress administration menu.
  2. Click Settings.
  3. Click the Option Management tab at the top of the page.
  4. Enter your license key.
  5. Click the Activate button.

If your license key fails to activate, please ensure you are using the correct license key and not your WS Form PRO license key.

Creating a Form for Option Management

Automatically

To automatically create an Option Management form in WS Form:

  1. Click WS Form in the WordPress administration menu.
  2. Click Add New.
  3. Select the Option Management tab at the top of the page.
  4. Click on a form template. If you have ACF, JetEngine or Meta Box settings pages, templates are automatically created for those.
  5. Wait a few moments while the form is created.

That’s it! Your form will be created and is ready to add to your website.

Manually

It is also possible to use any form created in WS Form and add an action so that fields values are pushed to WordPress options.

To add an Option Management action:

  1. When editing your form, click the Actions icon at the top of the page. The Actions sidebar will open on the right-hand side of the page.
  2. Click the Add  icon to add a new action.
  3. Select Option Management from the Action pulldown. A series of settings will appear.

As with all sidebars in WS Form, click on the Save button at the bottom to save your changes, or click Cancel to disregard your changes.

The Option Management action settings are as follows:

When Should This Action Run?

You can choose to run the Option Management action when the form is saved, submitted, or both.

Source

Choose the options source. For regular WordPress options, use Custom. If you are pushing a custom field plugin settings page, choose the setting page from this option. If you need to push options to multiple settings pages, add multiple actions.

Field Mapping

Field mapping tells WS Form which of your form fields relate to corresponding WordPress options.

To map a field:

  1. Click the Add  icon at the bottom right of the field mapping section.
  2. In the left-hand column, select your Form Field.
  3. In the middle column, enter the option Name.
  4. In the right-hand column, choose the Autoload setting. Learn more about the option Autoload setting.
  5. Repeat this process for each field on your form.
  6. Click the Save button at the bottom of the sidebar to save your changes.

Custom Mapping

The add-on also supports setting custom option values.

To add a custom mapping:

  1. Click the Add  icon at the bottom right of the meta mapping section.
  2. In the left-hand column, enter the option Name.
  3. In the middle column, enter the option Value. WS Form variables can be used in this column.
  4. In the right-hand column, choose the Autoload setting. Learn more about the option Autoload setting.
  5. Repeat this process for each mapping.
  6. Click the Save button at the bottom of the sidebar to save your changes.

Populating a Form with Option Data

As well as pushing data to WordPress options, you can also populate a form with option data. To do this:

  1. Click on the Form Settings icon at the top of the layout editor.
  2. Click the Data tab.
  3. Check the Populate Using Action checkbox.
  4. Choose Option Management.
  5. Choose which option settings you want to populate from under List to Populate From.
    1. For WordPress options choose Custom.
    2. To populate from a custom field plugin such as ACF or Metabox choose the appropriate Settings Page.
  6. Use the mappings settings to map the options to your form fields.
  7. Click Save & Close.
  8. Click Publish to push the changes live.

Custom Field Settings

If you are using a custom field plugin for WordPress such as Advanced Custom Fields (ACF) or Meta Box, addition mapping options will appear to allow you to map WS Form fields to your settings page custom fields.