• Resolved myuption

    (@myuption)


    Still testing the plugin in an old and big blog.

    On posts with galleries, instead of leaving the code as:

    [gallery link="file" ids="11952,11954,11956,11958,11960,11962,11964,11966,11968,11970,11972,11974"]

    It is transformed into an html block like this inside the database:

    <!-- wp:gallery {"ids":[11952,11954,11956,11958,11960,11962,11964,11966,11968,11970,11972,11974],"columns":3,"linkTo":"file"} -->
    <figure class="wp-block-gallery columns-3 is-cropped"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://localhost/wp-content/uploads/2021/06/IMAGE.jpg"><img src="https://localhost/wp-content/uploads/2021/06/IMAGE.jpg" alt="" data-id="11952" class="wp-image-11952"/></a></figure></li><li class="blocks-gallery-item"><figure><img data-id="11954" class="wp-image-11954"/></figure></li><li class="blocks-gallery-item"><figure><img data-id="11956" class="wp-image-11956"/></figure></li><li class="blocks-gallery-item"><figure><img data-id="11958" class="wp-image-11958"/></figure></li><li class="blocks-gallery-item"><figure><a href="https://localhost/wp-content/uploads/2021/06/IMAGE.jpg"><img src="https://localhost/wp-content/uploads/2021/06/IMAGE.jpg" alt="" data-id="11960" class="wp-image-11960"/></a></figure></li><li class="blocks-gallery-item"><figure><img data-id="11962" class="wp-image-11962"/></figure></li><li class="blocks-gallery-item"><figure><img data-id="11964" class="wp-image-11964"/></figure></li><li class="blocks-gallery-item"><figure><img data-id="11966" class="wp-image-11966"/></figure></li><li class="blocks-gallery-item"><figure><img data-id="11968" class="wp-image-11968"/></figure></li><li class="blocks-gallery-item"><figure><img data-id="11970" class="wp-image-11970"/></figure></li><li class="blocks-gallery-item"><figure><img data-id="11972" class="wp-image-11972"/></figure></li><li class="blocks-gallery-item"><figure><img data-id="11974" class="wp-image-11974"/></figure></li></ul></figure>
    <!-- /wp:gallery -->

    Would be nice if the gallery stayed the same.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @myuption,

    > Would be nice if the gallery stayed the same.

    What do you mean when you want the gallery to stay the same?

    It’s expected behavior when Convert to Blocks transforms the gallery shortcode into a block as you mentioned above. The structure of the converted block is the same as adding a new gallery block.

    Thread Starter myuption

    (@myuption)

    However, the gallery code, or shortcode, it is changed in the database source, instead of remaining as:

    [gallery link="file" ids="11952,11954,11956,11958,11960,11962,11964,11966,11968,11970,11972,11974"]

    It is replaced by the html code.

    I made several posts using blocks and the sql database shows the shortcode, not the html.

    I made several posts using blocks and the sql database shows the shortcode, not the html.

    @myuption I can’t reproduce this behavior. I create new posts containing gallery blocks and the block content is saved to the database, not the shortcode. I’m testing using WordPress 5.8. See the screenshot: https://share.getcloudapp.com/lluojPnm

    Thread Starter myuption

    (@myuption)

    I just made a new copy of this blog, I will test once again and see how it goes.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Funny behavior on galleries’ is closed to new replies.