Support » Plugin: WordPress Gallery Plugin - NextGEN Gallery » [Plugin: NextGEN Gallery] Empty NextGen content after apply_filters( 'the_content', $conte

  • Hi everyone,

    I need to render my NextGen shortcodes (such as “[nggallery id=1]” or “[gallery id=1]“) to HTML at a very special time: during the “publish_post” action. (FYI, this action is triggered when you are in the “Edit Post” admin page and click the Publish/Update button.)

    I believe I’m doing this the accepted way with the following code:

    $postContent = apply_filters( 'the_content', $post->post_content );
    $postContent = str_replace( ']]>', ']]>', $postContent );

    My issue is that the result of the apply_filters() function. If the shortcode is “nggallery”, the shortcode is just skipped. If it’s “gallery”, an empty string replaces it.

    Other plugins render their output correctly. Not sure what’s special about NextGen other than it’s much more sophisticated than most plugins.

    Can anyone point me in the right direction regarding what’s going on and how to fix it?

    Thanks!

    http://wordpress.org/extend/plugins/nextgen-gallery/

  • The topic ‘[Plugin: NextGEN Gallery] Empty NextGen content after apply_filters( 'the_content', $conte’ is closed to new replies.