• Resolved keytastic

    (@keytastic)


    I write on my site using the mobile iOS app a lot and I’ve noticed that it’s not currently possible to insert a gallery from it (except for manually typing out the shortcode, of course). Obviously, it would be most ideal for WordPress to just fix this in the app, but I’ve also found that it would be convenient–even on a desktop browser–if when you insert several images in a row it would automatically convert them to a gallery.

    How difficult would it be to code a plugin to do this? It would need to grab the image IDs from the <img> tags and then construct the shortcode [gallery type="rectangular" ids=""].

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    It would be a fragile thing to detect several image insertions in a row. And how would code know when one is finished inserting images? So complete automation is unlikely.

    It should be possible to select several images, then click a toolbar button that then creates a gallery. It would be all javascript or jQuery. Getting the selection content is possible. Extracting the image IDs should be straight forward using RegExp search. Then replacing the selection with gallery shortcode is easy enough.

    Making it idiot proof gets more involved. What if there is other content in the selection? What if the button is clicked with no selection, or no images selected?

    Adding buttons to the toolbar is possible, though I personally don’t know what’s involved. The information is out there somewhere.

    Thread Starter keytastic

    (@keytastic)

    Thank you for that detailed answer. I think I’ll just insert the galley by hand for now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Auto Gallery Repeated Images’ is closed to new replies.