I am trying to enter a shortcode in the post search filter dialog box and get an error based on the shortcode name. The majority of my shortcodes, including those provided by plugin authors, include a _ but this causes an error as shown in the attached image. I think it was working until the latest types update which I installed earlier today but am not sure.
The image upload button does not work in Microsoft Edge.
Connected using Firefox to add image showing problem
Hi Graham,
Thank you for contacting us and I'll be happy to assist.
Your observation is correct and the Views plugin currently only allows lowercase letters and numbers as shortcode attributes label/title in views shortcode.
But this should not restrict you from using the values from other custom or third-party shortcodes, which do have underscore ( _ ) in their names.
For example, suppose that you have a shortcode [currentuser_id], whose value you'd like to pass to your view, as a shortcode attribute.
In the filter's settings, you can use the label/title of this attribute as "currentuserid" which will be accepted.
But when you'll need to call the view, with that value passed as shortcode attribute, you'll still be able to use the shortcode like this:
[wpv-view name="Name of the view" currentuserid="[currentuser_id]"]
Please note how that restriction only applies to the label/title of the attribute and not to its value.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar