Support » Plugin: Contact Form 7 » One form multisite

  • Resolved vespino

    (@vespino)


    I’m hoping to use CF7 on my multisite installation in a way I can use one form on all my sites. Until now it’s working great, using the following code I have managed to show the form on all sites:

    function shortcode_wpse_87634() {
        // Main site, ID=1, that has the form
        switch_to_blog( 1 );
    
        // Do your stuff
        $my_stuff = do_shortcode('[contact-form-7 id="71" title="Contact"]');
    
        // Back to original site
        restore_current_blog();
    	
        // Return shortcode content
        return $my_stuff;
    }
    add_shortcode( 'global_form', 'shortcode_wpse_87634' );

    Validation of the form works on the main domain, but not on child domains and I can’t seem to find out why. Is this something that should work or am I looking to do the impossible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • +1 exactly the same problem here.

    thanks

    +1 Same.

    So long as the plugin is active on both blogs, switch_to_blog & do_shortcode will generate the form. But I can’t validate/submit the form.

    Did you ever figure this out?

    Thread Starter vespino

    (@vespino)

    Nope. For now I’m using a simple HTML form with some AJAX validation which does the trick for me.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘One form multisite’ is closed to new replies.