WordPress.org

Ready to get started?Download WordPress

Forums

How to do this in multisite... (3 posts)

  1. tUpston
    Member
    Posted 4 years ago #

    I want to make it so when a new user registers and gets a site, their site comes "preloaded" with a set of certain pages.

    I've also set up some network-wide plugins that require simple shortcode, which I would like to have automatically placed on those preloaded pages.

    How can I do this? If I want to code it myself, where would I start looking to make changes? I appreciate any help.

  2. Douglas Bell
    Member
    Posted 4 years ago #

    You'll probably want to code this yourself. You can use WordPress' Plugin API to create a function that does all of these things, then use the following action hook to register your function:
    add_action('wpmu_new_blog', 'your_function_here');

    With that, WordPress will execute the function your_function_here() whenever a new site is created. The your_function_here() function should accept one argument, which is the ID number of the blog that was just created.

    I would also recommend placing that plugin instead of the wp-content/mu-plugins/ directory (you have to create that directory yourself, it's not there by default), which will automatically ensure that your plugin is executed on all sites.

  3. Also remember that the mu forums are still available to search and there is *tons* of stuff in there.

    http://www.google.com/search?sitesearch=mu.wordpress.org&q=add+new+default+pages

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.