Forums

[Plugin: NextGEN Gallery] shortcodes in picture description (1 post)

  1. jrbriggs
    Member
    Posted 2 years ago #

    Hi Alex

    One of the users of my plugin was using my (e-commerce) tags in the description of pictures in his (nextgen) gallery. This all worked fine with NGG, when I wasn't using WP's shortcode support, but now that I've changed, it's broken.

    I've found that if I make a minor change to the NGG code, it partially fixes the problem.

    In the file nggfunctions.php, changing...
    $picturelist[$key]->caption = ( empty($picture->description) ) ? ' ' : html_entity_decode ( stripslashes(nggGallery::i18n($picture->description)) );

    to...

    $desc = do_shortcode($picture->description);
            $picturelist[$key]->caption = ( empty($desc) ) ? ' ' : html_entity_decode ( stripslashes(nggGallery::i18n($desc)) );

    ...makes the shortcodes in my plugin at least execute (if not work properly). A subsequent change to my code gets around that problem (properly formatted attributes don't work, but that's a small price to pay -- at least it works).

    Not sure if support for shortcodes in descriptions is something you're looking at adding, but if so, this would be a good first step.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.