Hello,
We use shortcoder pro in a multisite where we have defined on the site with the ID 1 some shortcodes containing SQL expressions. Then in function.php we have defined a function to execute that queries from any other site in this way:
add_filter( 'do_shortcode_tag','pre_query_mssql_execute',10,3);
function pre_query_mssql_execute($output, $tag, $attr)
{
if (isset($attr['name']))
phpAlert('Attr name: ' .$attr['name']);
if (isset($attr['name']) && strpos($attr['name'], 'query_mssql') !== false) {
switch_to_blog(1);
$shortcodes = Shortcoder::get_shortcodes();
$shortcode_content = $shortcodes[strtolower($attr['name'])]["content"];
$output = query_mssql_execute($shortcode_content,$attr);
restore_current_blog();
}
return $output;
}
It works but we lose some pretty feature like finding the shortcode around and the integration with WP Bakery page builder from sites with ID != 1.
Have you any plan to implement a feature like “site from where grab the list of shortcode” ?
Thank you.
A.