• Good day,

    In the process of migrating to gutenberg editor and it looks like posts created prior to gutenberg are put into a “classic” block and wonder what would be recommended strategy to dealing with these. Right now it looks like the classic block does not parse any of the shortcodes; like [code] shortcode just shows literal "[code]".

    First idea:
    Ideally, I would love to be able to convert all of these classic blocks to native gutenberg blocks but I am not clear what the best way to do that would be. On top of my head, I'm thinking looping through all the old posts with parse_blocks() then if the blockname is null, having it run through some custom parser. But then this idea seems very clunky to me.

    Second idea:
    Or perhaps in the backend, I can maintain the classic editor but in presentation, I can add logic like "if classic block, run it through this filter to process the shortcodes to render the presentation html"? (Hmm, is there a filter function that would render raw shortcodes?)

    Has anyone gone through this or have any other suggestions?

    Thanks in advance!

    • This topic was modified 5 years, 11 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
  • Hi,

    I personally haven’t run into the issue where the classic block doesn’t parse shortcodes. It all worked as expected for me when I did the transition.

    For the question about converting the classic blocks to Gutenberg blocks, if it’s only a handful of posts/pages that needs converting, you can convert it on the editor itself. Just select the classic block and click on the “More options” button (the three dots) that pops up just above it and select “Convert to Blocks”.

Viewing 1 replies (of 1 total)

The topic ‘Shortcodes in classic block?’ is closed to new replies.