File tree Expand file tree Collapse file tree
projects/packages/jetpack-mu-wpcom Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Significance: patch
2+ Type: fixed
3+
4+ Comments: Keep headings in P2 comments edited through the REST API.
Original file line number Diff line number Diff line change @@ -839,6 +839,14 @@ private static function should_disable_comment_experience( $blog_id ) {
839839 * Load Verbum Comments.
840840 */
841841 public static function load_verbum_comments () {
842+ // public-api boots on its own blog, so decide once the request has switched to its target.
843+ if ( 'public-api.wordpress.com ' === wp_parse_url ( home_url (), PHP_URL_HOST ) ) {
844+ // Now, for reads across sites that never switch: avatars only touch comments with our stored photo.
845+ \Automattic \Jetpack \Comments \Avatars::init ();
846+ add_action ( 'rest_api_switched_to_blog ' , array ( __CLASS__ , 'load_verbum_comments ' ) );
847+ return ;
848+ }
849+
842850 if ( class_exists ( 'Verbum_Comments ' ) ) {
843851 return ;
844852 } else {
@@ -865,8 +873,8 @@ public static function load_verbum_comments() {
865873
866874 /**
867875 * Register Jetpack Comments' browser-facing routes ahead of the comment
868- * experience gates. admin-ajax is is_admin(), and a public-api request runs
869- * plugins_loaded on the wrong blog, so load_verbum_comments() skips both .
876+ * experience gates. admin-ajax is is_admin(), so load_verbum_comments() skips it,
877+ * and on public-api it waits for the blog switch, which comes after rest_api_init .
870878 * Runs on every request, blog 1 and P2s included, on purpose: the routes
871879 * gate themselves on Comments::is_enabled(), as Posts_To_Podcast_Endpoint does.
872880 */
You can’t perform that action at this time.
0 commit comments