Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a network with more than 50 sites. I want to create one contact form (which means one shortcode) using contact form 7 or fast secure contact form. Then, I want to use that shortcode on all the 50+ sites so all sites use the same form.

The problem is that when I try to use a shortcode of site A over site B, it's not working.

Do you know how can I use a contact form shortcode globaly on all sites at once?

Thanks!

share|improve this question

put on hold as off-topic by Pieter Goosen, birgire, toscho yesterday

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
I will try that. Thank you very much! –  tomastsc Feb 23 '13 at 8:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.