Support » Plugin: WordPress Gallery Plugin - NextGEN Gallery » Getting gallery ID from gallery attached to post using Tinymce button

  • Resolved bczegeny

    (@bczegeny)


    Does anyone know how to retreive the gallery ID from the tag that is places in the post when using the Tinymce green nextgen button.

    Example:

    <img class="ngg_displayed_gallery mceItem" src="http://www.example.com.ca/nextgen-attach_to_post/preview/id--3940" alt="" />

    What is 3940? I need to know how that correlates to the gallery it is adding?

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 1 replies (of 1 total)
  • Benjamin

    (@benjaminowens)

    Galleries created through the green button are stored as custom posts in wp_posts. You can use the NextGen API to retrieve these like so:
    $mapper = C_Displayed_Gallery_Mapper::get_instance()->find($id); These posts are just the equivalent of serialized shortcodes.

    I’m working on some documentation on the NextGen internals & API that may help; though it’s not done yet I welcome any questions or criticism.

Viewing 1 replies (of 1 total)
  • The topic ‘Getting gallery ID from gallery attached to post using Tinymce button’ is closed to new replies.