Created
March 12, 2026 22:02
-
-
Save peterwilsoncc/d1db09cb4524e077be75b6f0749eddd1 to your computer and use it in GitHub Desktop.
An mu-plugin for WordPress to disable RTC by default without preventing its use later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Override WordPress upgrade defaults. | |
| * | |
| * Modify defaults set during the upgrade routine. | |
| * | |
| * @package pwcc-site | |
| */ | |
| namespace PWCC\Upgrade; | |
| /** | |
| * Bootstrap for upgrade related overrides. | |
| * | |
| * Runs as the plugin is included. | |
| */ | |
| function bootstrap() { | |
| add_action( 'wp_upgrade', __NAMESPACE__ . '\\disable_real_time_collaboration_by_default', 10, 2 ); | |
| } | |
| // Bootstrap immediately when the plugin is loaded. | |
| bootstrap(); | |
| /** | |
| * Disable Real Time Collaboration by default after upgrade. | |
| * | |
| * @param int $new_db_version The new database version. | |
| * @param int $old_db_version The old database version. | |
| */ | |
| function disable_real_time_collaboration_by_default( $new_db_version, $old_db_version ) { | |
| if ( $old_db_version < 61644 ) { | |
| update_option( 'wp_enable_real_time_collaboration', '0' ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment