permalinks – flush_rewrite_rules on MultiSite

Question

I’m trying to update all the permalinks on my MU install. But I’m not sure how to go about it.

This is what I have so far. But I think it’s only updating the first sites permalinks.

   switch_to_blog( $site->id );
    delete_option( 'rewrite_rules' );
    global $wp_rewrite;
    $wp_rewrite->init();
    $wp_rewrite->flush_rules();
   restore_current_blog();

0
Picard102 4 months 2022-04-22T22:26:48-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse