WP Multisite: Adding pages on blog creation by default
The hook is not the problem – your code runs in the context of the current site, not the one just created! The following code isn’t tested, but it should at least highlight the problem: function wpse_71863_default_pages( $new_site ) { $default_pages = array( ‘Impress’, ‘Contact’, ); switch_to_blog( $new_site->id ); if ( $current_pages = get_pages() ) … Read more