I wonder if you have some idea - perhaps I am approaching this the wrong way !
Tell us what you are trying to do?
I have a a view setup to show user profiles and I would like to generate a field called coworker from the wordpress user which will display a booking calendar
Is there any documentation that you are following?
not really but the other plugin software doc is here hidden link
Is there a similar example that we can see?
the following outputs what I want
<div class="row">
<div class="col-sm-4">[wpv-user field="ID"]</div>
<div class="col-sm-4">[tb-calendar coworker="6"]</div>
</div>
but I would like to manually build the tb-calendar shortcode to be reflect the current Userid in the loop
e.g. so that [tb-calendar coworker="wpv-user field="ID""]
What is the link to your site?
just a test but hidden link
thank you that seems to work, although it seems to be much slower in rendering the calendar display ... so let me post here a question from the calendar developer, to I/we can decide this is a good solution as I am about to create a reliance on this shortcode and I expect there might be a better way to do it.
from TB Calendar developer
'... if I correctly understood, you need the shortcode (let’s say [tb-calendar coworker=”auto”] ) to automatically detect the WP User ID inside the loop and print a calendar for that user only, but could you please define such “loop”? ' '...I don’t know how the Toolset Views plugin works, so I need to know if it is “transparent” (i.e. I can use a standard WordPress function like get_current_user_id() to retrieve it). '
can you let me know how to describe the way this user archive loop (for want of a better way to describe it) works ?
Sorry maybe the update was not clear I think the teambooking developer was simply floating an idea but asking toolset developers before implementing:
How the Toolset Views plugin works - If if it is “transparent” --- i.e. Can we use a standard WordPress function like get_current_user_id() to retrieve it.
but yes I tried to prove the point !
hidden link
explains things
for now [tb-calendar coworker="[wpv-user field='ID']"] is working ... but l would appreciate the opinion of a toolset developer as to the best way to achieve this without guessing; I am surprised imbedding one shortcode inside another works.
How the Toolset Views plugin works - If if it is “transparent” --- i.e. Can we use a standard WordPress function like get_current_user_id() to retrieve it.
=> Well, yes, you can use it but not directly. You should wrap the get_current_user_id() with custom shortcode and return the user ID and use this custom shortcode.
for now [tb-calendar coworker="[wpv-user field='ID']"] is working ... but l would appreciate the opinion of a toolset developer as to the best way to achieve this without guessing; I am surprised imbedding one shortcode inside another works.
==> Well - as said, [wpv-user field='ID'] shortcode will return the user ID. There is no guess work at all. This is confirmed and this is the way to use it.
Well, nested shortcodes are supported by WordPress (recursively, so with a little slowdown). I’m pretty much surprised, though, that a shortcode not really “nested” but used as attribute of another shortcode actually works too… I don’t know if that is a WordPress undocumented feature or something that such Toolset plugin handles directly.
Well - Toolset just returning the user ID based on the user shortcode passed to attribute. There is no harm in that.
If you do not want to use that - you should user another method where create a custom shortcode that returns the current user ID and use it. I do not have any other solution to offer you unfortunately.
I thought you guys wanted to work with other developers ? I was trying to find the best solution and one that's supported, as I am building a business dependency on it.
some final comments for you to comment on
'Well, nested shortcodes are supported by WordPress (recursively, so with a little slowdown). I’m pretty much surprised, though, that a shortcode not really “nested” but used as attribute of another shortcode actually works too… I don’t know if that is a WordPress undocumented feature or something that such Toolset plugin handles directly.'
Well - In Views we are doing a preparsing to determine if the transformed shortcode contains a shortcode attribute and if we detect such attribute we run do_shortcode on it before proceeding with the top-level shortcode transformation so you can have value without having any issue.
This is what our Dev said and what you get is expected results. The solution I gave is the best one as it will not going to break.
Yes - exactly, Views will be doing preparsing to determine if the transformed shortcode contains a shortcode attribute and
if we detect such
on that attribute (which contains the shortcode as attribute value) we run do_shortcode on it before proceeding with the top-level shortcode transformation so you can have value without having any issue.