cdillon/local-shortcodes — pull request #1 by eliot-akira (2014-12-22 19:10:38+00:00)
Title: Support for nested local shortcodes

Funny thing happened today - I came across a situation where I wanted to declare local shortcodes safely without any potential namespace conflict. So, I copied shortcodes.php from WP core, quickly went through and added a local namespace feature. As I continued working, I had to solve a tricky situation with nested local shortcodes - to have the inner local shortcode save and restore its parent's context.

Anyway, I then remembered our prior conversation on this topic, dug through our e-mails and realized that you had already done the exact same thing with local-shortcodes.php.. I guess I'd read through your code about a month ago, totally forgot about it, and recreated the same result. I see you've added some extra functionality to pass a post - I'm curious to find out how it works.

So, I incorporated what I had with your codebase. As you see, the parent context is restored after *preg_replace_callback*, to allow for nested local shortcodes.