Shortcode wpda_app supports custom shortcode parameters, allowing plugin users to utilize any parameter name in a shortcode and incorporate its value into the default WHERE clause.
Shortcode example #
[wpda_app app_id="17" status="pending"]
Usage in default where clause #
(status like shortcodeParam['status'] or shortcodeParam['status'] is null)
Usage examples #
student_id = shortcodeParam['student_id'] and shortcodeParam['student_id'] is not null
first_name like if( shortcodeParam['student_firstname'] is null, first_name, concat( '%', shortcodeParam['student_firstname'], '%' ) )
student_id = ifnull( shortcodeParam['student_id'], student_id )
Notes #
- Null is returned when no shortcode parameter with the given name is provided
- Values are sanitized and prepared automatically
- This feature is available to all users and does not require a premium license
Parameters filter_field_name and filter_field_value #
Shortcode wpda_app also supports the parameter combination filter_field_name and filter_field_value as available in older tools:
- filter_field_name: comma separated list of column names
- filter_field_value: comma separated list of column values
Examples #
Query single column value.
[wpda_app app_id="17" filter_field_name="status" filter_field_value="closed"]
Use comma separated lists for both, filter_field_name and filter_field_value, to query multiple columns simultanaously.
[wpda_app app_id="3" filter_field_name="firstname,lastname" filter_field_value="peter,schulz"]
Shortcode parameter using wildcards.
[wpda_app app_id="11" filter_field_name="firstname" filter_field_value="jose%"]
Notes #
- The number of column names must match the number of column values
- Column names must be part of the queried database table
- The filter_field_value supports wildcards searches (use % as wildcard character)