Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • Karen Gee
    Participant

    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!
    Karen

    Hi 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,
    Aakash

    Karen Gee
    Participant

    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.
    Thanks
    Karen

    Happy that you like Shortcoder and thanks for the kind donation 🙂

    Cheers !

    Thanks,
    Aakash

    kristian
    Participant

    Hi 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
    Kristian

    Hi 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,
    Aakash

    kristian
    Participant

    Hi 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Subscribe for updates

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter