OAuth1
OAuth1 copied to clipboard
Rewrite rules are flushed incorrectly for multisite.
$mu_blogs = wp_get_sites();
foreach ( $mu_blogs as $mu_blog ) {
switch_to_blog( $mu_blog['blog_id'] );
json_oauth_server_register_rewrites();
flush_rewrite_rules();
}
restore_current_blog();
This line will (may?) result in each site on the network inheriting the rewrite rules of the main site. Or the first 100 due to the default limit on wp_get_sites().
delete_option( 'rewrite_rules' ); would be a replacement, but things get ugly when there's a bunch of sites. :disappointed:
It may be best to just put up a notice in the network admin instead explaining that rewrites need to be flushed manually.
Also, restore_current_blog() only goes up one level in the stack. That should live in the foreach() or there should be a while( ms_is_switched() ).
Sorry, walking out the door and didn't have time to put together a proper PR. :star2: :boom: