I recently created a custom shortcode that can have as many as 35 parameters in it. It's a complicated item, so part of the reason I created the shortcode was so I could see the parameters easily if I typed them out in a grid like this:
[shortcode paraA1='123' paraB1='321'
paraA2='234' paraB2='432'
paraA3='345' paraB3='543' ]
It works just fine, except if I type them out like above in succession, it will completely ignore the top ones and only parse the bottom one. So this:
[shortcode paraA1='123' paraB1='321'
paraA2='234' paraB2='432'
paraA3='345' paraB3='543' ]
[shortcode paraA1='456' paraB1='654'
paraA2='567' paraB2='765'
paraA3='678' paraB3='876' ]
[shortcode paraA1='789' paraB1='987'
paraA2='890' paraB2='098'
paraA3='901' paraB3='109' ]
will parse as if I had only typed this:
[shortcode paraA1='789' paraB1='987'
paraA2='890' paraB2='098'
paraA3='901' paraB3='109' ]
The source code shows as if the first two shortcodes do not even exist. It will also ignore any code that is between them.
However, if I type them out without the line breaks (i.e. all inline) then it will work without any issues. For example:
[shortcode paraA1='123' paraB1='321' paraA2='234' paraB2='432' paraA3='345' paraB3='543' ]
[shortcode paraA1='456' paraB1='654' paraA2='567' paraB2='765' paraA3='678' paraB3='876' ]
[shortcode paraA1='789' paraB1='987' paraA2='890' paraB2='098' paraA3='901' paraB3='109' ]
will work just fine.
I have multiple items running that kill wpautop
, so I'm pretty sure it's not that. How can I fix this problem so that shortcodes will run correctly with line breaks in them?
I always work in the text editor only, and never the visual editor.