The following environment variables can be used in WP Data Access
$$USERID$$ | WordPress user id |
$$USER$$ | WordPress user login |
$$EMAIL$$ | WordPress user email |
$$NOW$$ | Current date |
$$NOWDT$$ | Current date + time |
Environment variables can be used:
- As default value in Project Templates
- In where clauses of publications and projects
Notes
- Since version 5.2.3 the WordPress user ID is also available via a session variable for all local and remote database connections. This features allows plugin users to use the WordPress user ID in queries, views, database triggers and stored procedures. Custom values are supported as well and can be added using a hook. Read more…
Hello,
it would be very nice to be able to use and define custom “environment” variables to create more complex queries. Is this possible or would/will this be possible? I am thinking for example of PHP session variables or a custom array/list of values coming from logic derived from php code snippets.
Hi Guido,
Shortcode parameters allow you to safely add your own custom filter:
https://wpdataaccess.com/docs/data-tables-filters/static-filters/
You can use this in combination with the do_shortcode command from your own PHP snippet. Let me know if you are missing functionality. We can always add new features… 🙂
Hope this helps,
Peter