July 8, 2021 at 5:51 pm #9706Karen GeeParticipant
Since the latest update (3 days ago) I’m getting weird things happening with content appearing and disappearing on my articles.
It seems to be to do with the [/sc] either appearing or not appearing, but there doesn’t seem to be any consistency so I’m getting very confused!
I’ve made a loom to show what’s happening:
The page it was on is https://www.cyclesprog.co.uk/family-cycling-advice/best-place-to-buy-a-kids-bike/
KarenJuly 8, 2021 at 10:59 pm #9707
Thanks for using Shortcoder. Really appreciate the time and effort you have taken to share your observation.
The reason why you are seeing this discrepancy is because of the following reason
When you have open shortcode followed by a closed shortcode, WordPress thinks that the there is only one “closed” shortcode. Rest of the content is considered as “enclosed content” for the first shortcode.
[sc name="mysc1"] Some content [sc name="mysc2"][/sc]
In this case,
some content [sc name="mysc2"]is considered as enclosed content for the shortcode
[sc name="mysc1"] ... [/sc]. Hence all the content inbetween is seen missing.
This is a known limitation with WordPress itself. It is documented here – https://codex.wordpress.org/Shortcode_API#Unclosed_Shortcodes
So to address this issue, starting Shortcoder v5.5, the “select and insert” popup will always insert all the shortcodes with a closing tag. So that above issue is not observed. You can always use open shortcode, but ensure that there are no closed shortcodes down the page.
I agree that this is a confusion, I’ll add a FAQ to inform users about this and suggest to add
[/sc]tag for their existing shortcodes.
AakashJuly 9, 2021 at 12:24 am #9710Karen GeeParticipant
Thank you so much for your quick response Aakash – this is really helpful. We’ll make sure when we add in new shortcodes we close off the existing ones.
KarenJuly 9, 2021 at 12:45 am #9711
Happy that you like Shortcoder and thanks for the kind donation 🙂
AakashJuly 12, 2021 at 7:23 pm #9722kristianParticipant
Thanks for the amazing plugin, it’s been really useful. We experienced this same problem with disappearing content, but luckily it was explained here very clearly.
I’m not quite sure what we should do now however, as we have used probably thousands of shortcodes and none of them are closed. Whoops! It will be a Herculean task to change them all…
I’m wondering if it might be possible to add an option in the plugin settings to choose whether the “select and insert” popup will in fact insert the closing tags or not? I guess we could always roll back to the previous version of the plugin, too. 🙂
KristianJuly 12, 2021 at 11:39 pm #9731
Thanks for using Shortcoder and for your donation. Happy to receive it 🙂
Regarding the issue, I agree it caused a temp inconvenience for existing users. This change will ensure new users insert all closing shortcode to avoid any issue in the future.
As you have mentioned, I’ll add an option in the plugin’s general settings to save this as a preference.
I’ll try to release the update after WP 5.8 is released which is Jul 20th.
I’ll update this thread, once this option is available.
Meantime, I would suggest to delete the
[/sc]part after the shortcode is inserted in the editor.
AakashJuly 12, 2021 at 11:49 pm #9733kristianParticipant
Sounds great! Yes, it’s good to teach new users to close the shortcode, but thanks for not forgetting us who have done it differently. 🙂
Looking forward to the update.
- You must be logged in to reply to this topic.