How to insert current user ID in a shortcode?


I have a shortcode from a plug-in called Pods that is used like

[pods-form name="user" id="" fields="my_field, my_field_2, my_field_3"] 

Parameter name contains the name of the custom post type (here: enhanced the WP user post type). Parameter id now shall receive the user ID of the currently logged in user. The page containing this shortcode is only available to logged-in users. How to add the current user ID as a variable to this shortcode?

I’m looking for something like this

[pods-form name="user" id="{@user_ID}" fields="my_field, my_field_2, my_field_3"]
, , Bunjip 3 years 2020-05-31T11:10:32-05:00 0 Answers 88 views 0

Leave an answer