Appearance
Shortcode Parameters
The wpda_app shortcode supports custom parameters, allowing you to add any parameter to a shortcode and safely reference its value in WHERE clauses.
📌 This feature is not available for data apps.
📌 This page explaines custom shortcode parameters.
📌 Standard plugin shortcode parameters are explained in section Shortcode Usage.
✨ Shortcode parameter example
[wpda_app app_id="17" status="pending"]The parameter status with the value pending is added to the second shortcode.
✨ WHERE clause example using shortcode parameter status
sql
WHERE status = IFNULL(shortcodeParam['status'], status)In this WHERE clause:
- The column status is compared with the shortcode parameter value using
shortcodeParam['status']. shortcodeParam['status']returns NULL if the shortcode parameter status is not provided.
📌 Shortcode parameters can be used in the default WHERE clause in the Table Builder, Map Builder, and Chart Builder.
Examples
✨ Exact match with null check
sql
WHERE student_id = shortcodeParam['student_id']
AND shortcodeParam['student_id'] IS NOT NULL✨ Smart wildcard search
sql
WHERE first_name LIKE IF(
shortcodeParam['firstname'] IS NULL,
first_name,
CONCAT('%', shortcodeParam['firstname'], '%')
)