Skip to content

Instantly share code, notes, and snippets.

@ScottDeLuzio
Created January 25, 2017 22:55
Show Gist options
  • Save ScottDeLuzio/1ad5ced5910ff5ba684a5f13488b8556 to your computer and use it in GitHub Desktop.
Save ScottDeLuzio/1ad5ced5910ff5ba684a5f13488b8556 to your computer and use it in GitHub Desktop.
mainwp_addsite and mainwp_editsite
// for add child site
$params = array(
'url' => 'http://childsite.com', // child site url
'name' => 'my child site', // set name
'wpadmin' => 'admin-user-name',
'unique_id' => '', // set value if needed
'groupids' => array( ... ), // array of group ids
'ssl_verify' => 0, // or 1, 2
'ssl_version' => 'auto',
'http_user' => '', // set value if needed
'http_pass' => '', // set value if needed
);
$result = apply_filters('mainwp_addsite', $params);
// for update child site
$params = array(
'websiteid' => ID-NUMBER, // child site id
'name' => 'my child site', // set name
'wpadmin' => 'admin-user-name',
'unique_id' => '', // set value if needed
);
$result = apply_filters('mainwp_editsite', $params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment