private function createShortcodeHandler(Shortcode $shortcode) { return function ($userAttrs) use($shortcode) { $resolvedAttrs = \shortcode_atts($shortcode->getDefaultAttributes(), $userAttrs); $context = new ShortcodeContext($userAttrs, $resolvedAttrs); return $shortcode->render($context); }; }