Add additional Network constants to wp-config.php dynamically

I haven’t tested this, but if you would need to find such a solution, I would probably try to do it in the following way by adding a script into the if ( SOME_CHECK_IF_STEP-1_WAS_PASSED ) condition you’ve described above, that would:

  • check the DB for the {$wpdb->prefix}sitemeta table;
  • if it does not exist -> return false;
  • if it does exists -> add a WP cron job to rewrite wp-config.php -> return true.

The WP cron job would rewrite the wp-config.php to eliminate the check completely.

This way, you only have an additional DB request until the network is set up and the cron job did its magic.

Note sure this is worth the effort, though… 😉

Leave a Comment