Skip to content

Commit

Permalink
Connection: send package versions on init hook
Browse files Browse the repository at this point in the history
Fixes #21165

Send the package versions to wpcom on the init hook instead of plugins loaded
to prevent a conflict with a third party plugin. The plugin isn't ready until the
'after_setup_theme' action has fired.
  • Loading branch information
kbrown9 committed Sep 23, 2021
1 parent 6d71e2b commit 89a2f21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Package Version Tracker: send package versions to wpcom on the init hook instead of plugins_loaded
2 changes: 1 addition & 1 deletion projects/packages/connection/src/class-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static function configure() {

if ( $manager->is_connected() ) {
add_filter( 'xmlrpc_methods', array( $manager, 'public_xmlrpc_methods' ) );
add_filter( 'plugins_loaded', array( new Package_Version_Tracker(), 'maybe_update_package_versions' ) );
add_filter( 'init', array( new Package_Version_Tracker(), 'maybe_update_package_versions' ) );
}

add_action( 'rest_api_init', array( $manager, 'initialize_rest_api_registration_connector' ) );
Expand Down

0 comments on commit 89a2f21

Please sign in to comment.