Suggestion: Allow for post-content's id (among other attributes) to use quotes
-
First off, thank you for the great plugin and I just have a quick suggestion for the next update.
My Thought
Many/most people using WordPress for their site aren’t programmers so they’re not well versed on what an integer is and what a string is (and why that matters). They just see that shortcodes commonly have their values wrapped in quotes. This becomes a problem when this plugin requires that some of the attributes being set can’t use quotes while others should use quotes.Suggestion
Therefore, I propose this plugin should allow[post-content id="25"]
to work rather than requiring[post-content id=25]
(which should still work). The goal is to follow the principle of accepting user input where you should accept a variety of inputs that then all work as the user would expect rather than forcing technical conventions upon them that they need to learn (and have things break unless followed).How to Implement
I’m not familiar with this plugin’s code base & I don’t see a way to easily submit change requests, but I’d suspect that any shortcode attribute that needs to be an integer should have a line in the plugin that auto-converts the user-provided value into an integer. Thus, making this plugin accept all attribute values with quotes.I know this might be tricky when determining category on post-list, but you could see if it’s able to be converted to an integer and determine if it’s a name or ID from there. It seems that’s the only attribute where it accepts both strings & integers.
Thanks for hearing me out!
https://www.ads-software.com/plugins/post-content-shortcodes/
- The topic ‘Suggestion: Allow for post-content's id (among other attributes) to use quotes’ is closed to new replies.