You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In wp_biblelink_shortcode(), you currently parse a string like "John 3:16" and split that up into relevant parts. While this works, it's a bit of a brittle approach in case you ever decide to change the input format, and though this might seem an obvious input format to you, perhaps it mightn't be for others?
A more conventional way for shortcodes to accept multiple parameters is to use WordPress' Shortcode_API() function. The shortcode could look something like [bible book="1samuel" chapter="1" verse="1"]. See https://codex.wordpress.org/Shortcode_API for documentation and more examples.
If you think specifying the input as "John 3:16" is absolutely the way to go, I'd still recommend first using the shortcodes attributes function to parse the input, and then we can re-implement parsing simple strings such as "John 3:16" against that -- happy to help with advice when you get there.
The text was updated successfully, but these errors were encountered:
In
wp_biblelink_shortcode()
, you currently parse a string like "John 3:16" and split that up into relevant parts. While this works, it's a bit of a brittle approach in case you ever decide to change the input format, and though this might seem an obvious input format to you, perhaps it mightn't be for others?A more conventional way for shortcodes to accept multiple parameters is to use WordPress'
Shortcode_API()
function. The shortcode could look something like[bible book="1samuel" chapter="1" verse="1"]
. See https://codex.wordpress.org/Shortcode_API for documentation and more examples.If you think specifying the input as "John 3:16" is absolutely the way to go, I'd still recommend first using the shortcodes attributes function to parse the input, and then we can re-implement parsing simple strings such as "John 3:16" against that -- happy to help with advice when you get there.
The text was updated successfully, but these errors were encountered: