using 1 form shortcode (si or cf7) for all multisite sites [closed]

A Must Use plugin could do the work.

This is just an outline and has to be fully tested:

add_shortcode( 'global_form', 'shortcode_wpse_87634' );

function shortcode_wpse_87634() 
{
    // Main site, ID=1, that has the form
    switch_to_blog( 1 );

    // Do your stuff
    $my_stuff = something(); // maybe do_shortcode

    // Back to original site
    restore_current_blog();

    // Return shortcode content
    return $my_stuff;
}

Also, maybe the contact form plugin must be Network activated for this to work.
Having the shortcode available Network-wide will work with the mu-plugin, but to have the form really working globally, that’s another issue.

Leave a Comment