PHP Examples
-
Change Form Submission Limit Settings Using PHP
Sometimes you might want to change form settings dynamically using PHP prior to the form being rendered on your website.
-
Change Tab Labels Using PHP
Sometimes you might want to change a tab label dynamically using PHP prior to the form being rendered on your website.
-
Create a Form Recipient Selector Using PHP
In this tutorial we'll show you how to allow a user to select a recipient using the wsf_action_email_to filter hook.
-
Custom Server-Side Form Validation
WS Form allows you to perform your own server-side validation of submitted fields values.
-
Data Sources: WordPress Filter Hook
The WordPress Filter Hook data source allows you to dynamically populate a data grids with your own data for fields such as Select, Checkboxes and Radios.
-
Enable and Disable Dates and Times Using PHP
This tutorial provides code samples for disabling and enabling dates and times in Date / Time fields.
-
Filter Disposable Email Addresses
Reject form submissions from unwanted email addresses using this WS Form filter.
-
Manipulate Submission Data Using WordPress Filter Hooks
When WS Form read or writes submission meta data, it can be filtered using WordPress filter hooks.
-
Populate Select, Checkbox and Radio Fields Using PHP
You can use WS Form functions to dynamically populate select, checkbox or radio fields.
-
Populate the Default Value of a Field Using PHP
You can use WS Form functions to dynamically set the default value of fields.
-
Preventing Users from Saving Markup in the Layout Editor
If you do not want to allow users to save markup in WS Form settings, use the unfiltered_html capability in WordPress.
-
Process Submit Data with a WordPress Hook
You can use the ‘Run WordPress Hook’ action in combination with some simple code to intercept submission data and use it in your own PHP scripts.
-
Redirect Existing Users by Role During Registration
When a user registers on your website using the User Management add-on you can redirect existing users by their role or other criteria.
-
Redirect Users by Role After Login
When a user logs in to your website using the User Management add-on, you may wish to redirect users by their role or other criteria.
-
Run WordPress Hook
The 'Run WordPress Hook' action runs a WordPress action or filter when a user saves or submits a form.
-
Setting Which Post ID to Populate With Using PHP
In this tutorial we show you how to change the 'Post ID' setting found in Form Settings > Data > Populate Using Action by using a simple PHP script.
-
Show Form Submission Count for a Specific Form
A PHP example showing how to create a shortcode that returns the total number of submissions for any form ID.