If statement in wp-config.php, is it possible?

Following on from the comments thread… Here’s a method I’ve used for a long time for handling the ‘not ideal’ scenario of different configurations between environments. The following is a heavily cut-down representation of wp-config.php but it demonstrates the idea… <?php /** * The base configurations of the WordPress. * * This file has the … Read more

Prevent Multisite from creating sample page, sample post and sample comments

When you create a new site with multisite WP does not automatically change the context. So your action is added to the current site, not the new site. You have to switch first. Like this: add_action (‘wpmu_new_blog’, ‘wpse296303_delete_wordpress_defaults’, 100, 1); function wpse296303_delete_wordpress_defaults ($blog_id, $user_id, $domain, $path, $site_id, $meta) { // Switch to the newly created … Read more