Hi Ben,
thanks for the feedback. I’m not a big fan of including JS files inline within the body tag. At the moment this happen with shortcode proessing, but I’m thinking about changing that. With a direct call – like you are asking for – there would be no way around that, as there is no way to tell wp_head() to place the according JS files within the head tag. I dislike that as much as I dislike iframes, BUT of course it might make sense in some scenarios:
Basically all you need is edge_suite_comp_render(id)
, which will return an array with keys ‘stage’ and ‘scripts’ (an array as well). You can put that together in a function:
function edge_suite_view_inline($definition_id, $css_style = ''){
$definition_res = edge_suite_comp_render($definition_id, $css_style);
$stage = $scripts = '';
if($definition_res != NULL){
$scripts = implode("\n", $definition_res['scripts']);
$stage = $definition_res['stage'];
}
return "\n" . $scripts . "\n" . $stage ."\n";
}
I’ll wait until I have figured out what to do with shortcodes before I’ll add the function to the plugin, otherwise I might have to change the function call later on. This could break stuff for people like you.
Hope that helps