fix: invalidate restored permalink option caches
This commit is contained in:
2 files changed
+11
-1
No files matched your search
@@ -80,6 +80,9 @@ function chrnx_fixture_environment_restore_raw_option( string $name, array $stat
|
||||
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Exact option nonexistence is required for reversible local fixtures.
|
||||
$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name = %s", $name ) );
|
||||
}
|
||||
wp_cache_delete( $name, 'options' );
|
||||
wp_cache_delete( 'alloptions', 'options' );
|
||||
wp_cache_delete( 'notoptions', 'options' );
|
||||
}
|
||||
|
||||
/** Synchronize the live permalink structure, optionally preserving an exact raw option row. */
|
||||
@@ -88,7 +91,6 @@ function chrnx_fixture_environment_sync_permalink_structure( string $permalink_s
|
||||
$wp_rewrite->set_permalink_structure( $permalink_structure );
|
||||
if ( is_array( $raw_state ) ) {
|
||||
chrnx_fixture_environment_restore_raw_option( 'permalink_structure', $raw_state );
|
||||
wp_cache_delete( 'permalink_structure', 'options' );
|
||||
}
|
||||
flush_rewrite_rules( false );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user