How does ToolWine ShortCodes Plugin work?
ToolWine ShortCodes requires Toolset Views and Types to be installed and active because often its ShortCodes will attempt to use or work with Toolset API and data.
When activated, the plugin offers its ShortCodes with very flexible arguments, in most ShortCodes you can pass valid WordPress Query Arguments as ShortCode attributes, and as value a value to search by. ToolWine plugin will then automatically build the respective query and output the result.
How do ToolWine ShortCodes work?
The ShortCode Output can usually be defined as Readable, Comma delimited list, or simple raw output. It can also be defined what part of the returned object to output, for example if you want to show the posts titles, you can specify this in the ShortCodes just as you could specify to get the Posts IDs, or a Taxonomy Terms Post Count
Any valid Post and Term Object property can be passed to the output attributes of ToolWine ShortCodes
All ShortCodes are automatically registered with Toolset Inner ShortCodes as well, so they become available in Conditional Output GUI of Toolset.
That’s not all – the ToolWine ShortCodes come with an inbuilt “discovery API”, where you can discover all registered ShortCodes and all their possible attributes directly on the Websites front end, without the need of reading the code or documentation. All you need to do is output the [tws_info] shortcode somewhere, or a particular ToolWine ShortCode with attribute info=”1″, to see its particular attributes supported.
And, to finish it up, you can register your own shortcodes for this machinery, by simply adding your Custom ShortCode callback to ToolWine’s engine using a plain simple WordPress add_filter().
Automagically, your ShortCode now not only is registered with ToolWine and Toolset Inner ShortCodes but you can even output the information of your ShortCode with the ToolWine ShortCodes [tws_info] and [your_shortcode info=”1″]!
No, that’s not all – now that you connected your ShortCode with ToolWine’s engine you can (if your code makes use of) simply pass a valid attribute=value pair to your Custom ShortCode and use it in your logic, without ever registering the attribute. ToolWine will try to fetch existing WordPress Query arguments and translate them so the custom attributes return expected data.