WordPress.org

Ready to get started?Download WordPress

Forums

Optional Content
Does not work with other shorttags as content (4 posts)

  1. MarcKersten
    Member
    Posted 3 years ago #

    Other shorttags within Optional Contents "if"-tags will show as plain text instead of computed content. Tried this with Scribd and Imageflow2. Anybody with a solution?

  2. aleskalex
    Member
    Posted 3 years ago #

    Still nothing... :(
    it'll be great if we can work it out!

  3. MarcKersten
    Member
    Posted 3 years ago #

    I have tested another similar plugin and nested shorttags don't work there either. Might be an architectural problem of WordPress ? :-(

  4. jRayx
    Member
    Posted 2 years ago #

    in "optional-content\optional-content.php" around line 160 it looks like this :

    return $content;

    Add this snippet before that line :

    $pattern = "/\[.*\]/";
    
                    if (preg_match($pattern, $content, $matches))
                    {
                        foreach ($matches as $shortcode)
                        {
                            $content = str_replace($shortcode, do_shortcode($shortcode), $content);
                        }
                    }

    So far this works with what i've tested. Enjoy :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic