WordPress Field should be a property of the WordPress $post object.
So ID or post_name or post_title
Ah – so I can’t look up a user specific field? Like user email or user ID? My bad.
Thanks for the response
Not currently with VirtualFields. You can with VirtualPosts.
Also you can with a custom function in your functions.php file.
Good to know – I can switch to VirtualPosts to achieve this so will try that.
Hello – so all is working on the virtual posts apart from the personalization aspect.
I have the below in my filter by formula
{user_url} = ‘get_userdata( $user_url)’
Is this where the personalization should occur?
Thanks
First off, what should happen if a user NOT logged in loads the page? Because we can’t “get_useredata” on a non-logged in user, and we don’t want to query Airtable for NULL or empty URLs.
Secondly, the purpose of a Virtual Post is to use a piece of the requested URL to fetch matching records from Airtable.
So some URLs like:
/airtable-users/chester
/airtable-users/matthew
Could use a single page (as a template) and a single Airpress Virtual Post configuration and load custom Airtable data into the template based on the requested URL.
If you want to fetch data based on the current logged in user, I would recommend just creating a normal WordPress page and then using a function in your functions.php file to either A) fetch the appropriate data and/or B) generate a custom shortcode to output exactly what you want where you want it.
Depending on your use case you could also have that function redirect users who are not logged in or just show a message telling them to login.
If you book some time with me at https://chetmac.setmore.com/ I can provide some code samples and probably provide a working solution in ~30 minutes.