Skip to content
🚀 Rapid Application Development with the App Builder

Default Where ​

Adds a static filter to the table query. Accepts valid SQL only.

WP Data Access - Map Settings - Default Where

Examples ​

✨ Basic Example ​

sql
where first_name like 'Sacha%'

✨ Example Using the WordPress User ID ​

The session variable @wpda_wp_user_id is available to access the current WordPress user ID.

sql
where user_id = @wpda_wp_user_id

> Read more about accessing the WordPress user ID

✨ Example Using HTTP POST Parameters ​

The functions httpGet, httpPost, and httpRequest can be used to access HTTP GET and POST parameters. All functions return null if the requested parameter is not provided.

sql
where product_id = httpPost['my_product_id']
  and httpPost['my_product_id'] is not null

> Read more about using shortcode parameters

✨ Example Using Shortcode Parameters ​

The function shortcodeParam can be used to access shortcode parameters. The function returns null if the requested parameter is not provided.

sql
where student_id = shortcodeParam['student_id']

> Read more about using shortcode parameter

✨ Example Using a Subquery ​

sql
where user_id in (
	select user_id 
	from wp_usermeta 
	where meta_key = 'wp_capabilities' 
	  and meta_value like '%coach%'
)

✨ Examples Using SQL Functions ​

sql
where order_date between date_sub(now(), interval 1 week) and now()
sql
where status = 'send'
  and order_date > date_sub(now(), interval 1 week)