Custom field for client sites

I’ve created a small plugin to add a custom field (webhost) to a child site. You can see it on Github:

The field shows up, but if I enter a value while connecting to a new site, it’s not saved. When I edit the site later it does get saved.

How can i change the code so it will work for new sites as well?

I’ve tried to add this, but it didn’t work:

//  Update the Webhost field in the database of the added new site
add_action( 'mainwp_added_new_site', 'jkws_mainwp_update_site', 10, 1 );
1 Like