-
AuthorPosts
-
July 8, 2021 at 5:51 pm #9706Karen GeeParticipant
Hello!
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:
https://www.loom.com/share/d442c39bab4348c1ae8fae3953b5c009
The page it was on is https://www.cyclesprog.co.uk/family-cycling-advice/best-place-to-buy-a-kids-bike/
Thank you!
KarenJuly 8, 2021 at 10:59 pm #9707Aakash ChakravarthyKeymasterHi Karen,
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.
An example:
[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.Cheers !
Thanks,
AakashJuly 9, 2021 at 12:24 am #9710Karen GeeParticipantThank 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.
Thanks
KarenJuly 9, 2021 at 12:45 am #9711Aakash ChakravarthyKeymasterHappy that you like Shortcoder and thanks for the kind donation 🙂
Cheers !
Thanks,
AakashJuly 12, 2021 at 7:23 pm #9722kristianParticipantHi Aakash!
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. 🙂
Best regards
KristianJuly 12, 2021 at 11:39 pm #9731Aakash ChakravarthyKeymasterHi Kristian,
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.Thanks,
AakashJuly 12, 2021 at 11:49 pm #9733kristianParticipantHi Aakash,
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.
Kind regards
Kristian -
AuthorPosts
- You must be logged in to reply to this topic.