Skip to content

Commit ac8e20c

Browse files
candy02058912matticbot
authored andcommitted
Update/redirect simple classic wpcom admin interface option update (#37921)
* Simple Classic: Redirect to Default interface after switching wpcom_admin_interface * changelog * Fix phan issues Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/9599675910 Upstream-Ref: Automattic/jetpack@ae322cb
1 parent f9eea1f commit ac8e20c

File tree

3 files changed

+79
-62
lines changed

3 files changed

+79
-62
lines changed

vendor/automattic/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ function wpcom_admin_interface_display() {
3636
// The option should always be available on atomic sites.
3737
! ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ||
3838
// The option will be shown if the simple site has already changed to Classic which means they should have already passed the experiment gate.
39+
// We can remove the redirection in wpcom_admin_interface_pre_update_option for simple sites after the experiment is finished.
3940
( function_exists( 'wpcom_is_nav_redesign_enabled' ) && wpcom_is_nav_redesign_enabled() ) ) {
4041
add_action( 'admin_init', 'wpcomsh_wpcom_admin_interface_settings_field' );
4142
}
4243

4344
/**
4445
* Track the wpcom_admin_interface_changed event.
4546
*
46-
* @param array $value The new value.
47+
* @param string $value The new value.
4748
* @return void
4849
*/
4950
function wpcom_admin_interface_track_changed_event( $value ) {
@@ -64,9 +65,9 @@ function wpcom_admin_interface_track_changed_event( $value ) {
6465
* @access private
6566
* @since 4.20.0
6667
*
67-
* @param array $new_value The new settings value.
68-
* @param array $old_value The old settings value.
69-
* @return array The value to update.
68+
* @param string $new_value The new settings value.
69+
* @param string $old_value The old settings value.
70+
* @return string The value to update.
7071
*/
7172
function wpcom_admin_interface_pre_update_option( $new_value, $old_value ) {
7273
if ( $new_value === $old_value ) {
@@ -83,6 +84,22 @@ function wpcom_admin_interface_pre_update_option( $new_value, $old_value ) {
8384
}
8485

8586
if ( ( new Automattic\Jetpack\Status\Host() )->is_wpcom_simple() ) {
87+
if ( 'calypso' === $new_value ) {
88+
// Fixes https://github.com/Automattic/dotcom-forge/issues/7760.
89+
// We can remove this code if the related code in wpcom_admin_interface_display is removed.
90+
add_action(
91+
'update_option_wpcom_admin_interface',
92+
/**
93+
* Redirects to the WordPress.com home page when the admin interface is changed to Calypso.
94+
*
95+
* @return never
96+
*/
97+
function () {
98+
wp_safe_redirect( 'https://wordpress.com/home/' . wpcom_get_site_slug() );
99+
exit;
100+
}
101+
);
102+
}
86103
return $new_value;
87104
}
88105

vendor/composer/installed.json

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"dist": {
7878
"type": "path",
7979
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
80-
"reference": "1166eb6d60bf9041fc24e92183e2be2eba4eaa50"
80+
"reference": "df1bf4887a74b037c675bcff58bcbaa7bcd327e9"
8181
},
8282
"require": {
8383
"php": ">=7.0"
@@ -130,7 +130,7 @@
130130
"dist": {
131131
"type": "path",
132132
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
133-
"reference": "69bbda0b31283c2f68c1a24d0689392693ca3661"
133+
"reference": "6f930f4234ebe0f9cd0d98af5d46edb71406ec13"
134134
},
135135
"require": {
136136
"php": ">=7.0"
@@ -195,7 +195,7 @@
195195
"dist": {
196196
"type": "path",
197197
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
198-
"reference": "d8252891c9aa01cb986e443c11a808d10de64d5b"
198+
"reference": "1d4daace4e0fbf9926f33b762b5eb289b998fcc2"
199199
},
200200
"require": {
201201
"automattic/jetpack-constants": "^2.0.3",
@@ -264,7 +264,7 @@
264264
"dist": {
265265
"type": "path",
266266
"url": "/tmp/jetpack-build/Automattic/jetpack-blaze",
267-
"reference": "d8d9b0e1b554c1a245bc77f5b29bfb21170d43ae"
267+
"reference": "7e72091fa4c44a9a2d3374dc8294a958e90fbc54"
268268
},
269269
"require": {
270270
"automattic/jetpack-assets": "^2.1.12",
@@ -345,7 +345,7 @@
345345
"dist": {
346346
"type": "path",
347347
"url": "/tmp/jetpack-build/Automattic/jetpack-blocks",
348-
"reference": "4c99d69e4d14da0db4cf4944c4bb74ccf5a7fc85"
348+
"reference": "3f183a69bf7d1e79f2ef9f3a82565e24b4fc8312"
349349
},
350350
"require": {
351351
"automattic/jetpack-constants": "^2.0.3",
@@ -407,7 +407,7 @@
407407
"dist": {
408408
"type": "path",
409409
"url": "/tmp/jetpack-build/Automattic/jetpack-calypsoify",
410-
"reference": "6649937f0c8fafc4ad47c2810b250eb331ba4a63"
410+
"reference": "8df37e36e4be881a47b60f306a2106629fb3fc42"
411411
},
412412
"require": {
413413
"automattic/jetpack-assets": "^2.1.12",
@@ -472,7 +472,7 @@
472472
"dist": {
473473
"type": "path",
474474
"url": "/tmp/jetpack-build/Automattic/jetpack-classic-theme-helper",
475-
"reference": "5e251a2c2f383be9fd2ec288c82c3fad4f0fdaa9"
475+
"reference": "ac34062a35f534d042d138d29c3c4f6b271d28a8"
476476
},
477477
"require": {
478478
"automattic/jetpack-assets": "^2.1.12",
@@ -543,7 +543,7 @@
543543
"dist": {
544544
"type": "path",
545545
"url": "/tmp/jetpack-build/Automattic/jetpack-compat",
546-
"reference": "1ec3fe0827a306c694747c129ced86958fcadee8"
546+
"reference": "4fc786efc36598989eae77b2a77fda885b3f583e"
547547
},
548548
"require": {
549549
"php": ">=7.0"
@@ -583,7 +583,7 @@
583583
"dist": {
584584
"type": "path",
585585
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
586-
"reference": "b0481b8a446ee51e840bfa6c44ad3a385ed8cc56"
586+
"reference": "beeeb5c5078ccc653ea12499d07f760582097187"
587587
},
588588
"require": {
589589
"php": ">=7.0"
@@ -659,7 +659,7 @@
659659
"dist": {
660660
"type": "path",
661661
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
662-
"reference": "707db26d28c1b2522d2c90f72e36b1ad79822af2"
662+
"reference": "08466f417b91543c277fe46b8729826a32c357bb"
663663
},
664664
"require": {
665665
"automattic/jetpack-a8c-mc-stats": "^2.0.1",
@@ -746,7 +746,7 @@
746746
"dist": {
747747
"type": "path",
748748
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
749-
"reference": "12996819eaf48f0791b2b2f5d63db6ec12d3e21a"
749+
"reference": "8314b6d13f2faa4e54be3f509c4c81d31469cfc5"
750750
},
751751
"require": {
752752
"php": ">=7.0"
@@ -800,7 +800,7 @@
800800
"dist": {
801801
"type": "path",
802802
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
803-
"reference": "f33a299c4e99cfc7ee61736ea9a6c124f83d3d63"
803+
"reference": "59a7a1f3f04097869d62351c61f6d160511e3012"
804804
},
805805
"require": {
806806
"php": ">=7.0"
@@ -853,7 +853,7 @@
853853
"dist": {
854854
"type": "path",
855855
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
856-
"reference": "ce996844bf1504dc40ae12c404a156933ebffff1"
856+
"reference": "272127626f3c308f7c3e9602a67c711b21d1fdc8"
857857
},
858858
"require": {
859859
"php": ">=7.0"
@@ -911,7 +911,7 @@
911911
"dist": {
912912
"type": "path",
913913
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
914-
"reference": "796e7c1fb8baf47f3f95d09b3184050cccee3dd5"
914+
"reference": "6c9211d283fb194305dfc828d847b2dd4cde081f"
915915
},
916916
"require": {
917917
"automattic/jetpack-a8c-mc-stats": "^2.0.1",
@@ -986,7 +986,7 @@
986986
"dist": {
987987
"type": "path",
988988
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
989-
"reference": "eda60aae7371e9b619b2c3ff9a91a814f1bf00ee"
989+
"reference": "749aaf37da2abcf047afd8ef703efed97bd6d6a2"
990990
},
991991
"require": {
992992
"php": ">=7.0"
@@ -1039,7 +1039,7 @@
10391039
"dist": {
10401040
"type": "path",
10411041
"url": "/tmp/jetpack-build/Automattic/jetpack-masterbar",
1042-
"reference": "b048e661d1126f983134bc2daf9142932ec25c8e"
1042+
"reference": "7f7edf0c9ff08a207fbac75beb2e7bf957071ec5"
10431043
},
10441044
"require": {
10451045
"automattic/jetpack-assets": "^2.1.12",
@@ -1116,12 +1116,12 @@
11161116
},
11171117
{
11181118
"name": "automattic/jetpack-mu-wpcom",
1119-
"version": "5.36.0-alpha.1718823492",
1120-
"version_normalized": "5.36.0.0-alpha1718823492",
1119+
"version": "5.36.0-alpha.1718895142",
1120+
"version_normalized": "5.36.0.0-alpha1718895142",
11211121
"dist": {
11221122
"type": "path",
11231123
"url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom",
1124-
"reference": "b0562a9b98fe9bed190d099bf0137573453cefec"
1124+
"reference": "cb8e3fcbbbc3d0b8e9b268b223c6c7cc031dc16c"
11251125
},
11261126
"require": {
11271127
"automattic/jetpack-assets": "^2.1.12",
@@ -1202,7 +1202,7 @@
12021202
"dist": {
12031203
"type": "path",
12041204
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
1205-
"reference": "3ca08362782e8a37d7990412181d53d11afc67ee"
1205+
"reference": "7ee6a545609499316ca6f0e9e2dec722e44856d2"
12061206
},
12071207
"require": {
12081208
"php": ">=7.0"
@@ -1263,7 +1263,7 @@
12631263
"dist": {
12641264
"type": "path",
12651265
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
1266-
"reference": "9542ca5932548665d098df6f6ee3473082756de5"
1266+
"reference": "cea4ef4c86d9776628aa4ee2dd336115d7218dc9"
12671267
},
12681268
"require": {
12691269
"automattic/jetpack-connection": "^2.10.1",
@@ -1331,7 +1331,7 @@
13311331
"dist": {
13321332
"type": "path",
13331333
"url": "/tmp/jetpack-build/Automattic/jetpack-post-list",
1334-
"reference": "7f068bd15114177ca32a10c427ceacd4377277bb"
1334+
"reference": "599067dd1f7fca2cb1564c9197316790338bfbcc"
13351335
},
13361336
"require": {
13371337
"automattic/jetpack-assets": "^2.1.12",
@@ -1396,7 +1396,7 @@
13961396
"dist": {
13971397
"type": "path",
13981398
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
1399-
"reference": "cff347b983332351797c8223983cbe343034dfec"
1399+
"reference": "94c3b7228d0245ffde8b6c61031ce246909908c3"
14001400
},
14011401
"require": {
14021402
"automattic/jetpack-status": "^3.3.1-alpha",
@@ -1451,7 +1451,7 @@
14511451
"dist": {
14521452
"type": "path",
14531453
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
1454-
"reference": "f2752f49a1414d6dd149118ae1389fe09e0dbb43"
1454+
"reference": "4587690aac77e9329856f0c536d4940789e6a9a7"
14551455
},
14561456
"require": {
14571457
"php": ">=7.0"
@@ -1505,7 +1505,7 @@
15051505
"dist": {
15061506
"type": "path",
15071507
"url": "/tmp/jetpack-build/Automattic/jetpack-stats",
1508-
"reference": "677d014e793fa570578babbfacfb43b75e75d86b"
1508+
"reference": "38647336a0c5f4e889157b9cbb99347d4a0d8251"
15091509
},
15101510
"require": {
15111511
"automattic/jetpack-connection": "^2.10.1",
@@ -1572,7 +1572,7 @@
15721572
"dist": {
15731573
"type": "path",
15741574
"url": "/tmp/jetpack-build/Automattic/jetpack-stats-admin",
1575-
"reference": "bc0a6d9ea3d4f26ace4e275177154e8a7853b03f"
1575+
"reference": "9c96fd57e58bf268ea452a90be0b33953b858de8"
15761576
},
15771577
"require": {
15781578
"automattic/jetpack-connection": "^2.10.1",
@@ -1645,7 +1645,7 @@
16451645
"dist": {
16461646
"type": "path",
16471647
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
1648-
"reference": "8a8cb36ecd51f97a62044e19567e214d4fdaa1a8"
1648+
"reference": "2b6d3a05d80606d332ea9e0951a08603a0c119f2"
16491649
},
16501650
"require": {
16511651
"automattic/jetpack-constants": "^2.0.3",
@@ -1710,7 +1710,7 @@
17101710
"dist": {
17111711
"type": "path",
17121712
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
1713-
"reference": "ef3513d278008060a3337a62d3778390d7da88b0"
1713+
"reference": "4144c1828f3a7bc273481a94f941a403f6ed1e44"
17141714
},
17151715
"require": {
17161716
"automattic/jetpack-connection": "^2.10.1",
@@ -1788,7 +1788,7 @@
17881788
"dist": {
17891789
"type": "path",
17901790
"url": "/tmp/jetpack-build/Automattic/scheduled-updates",
1791-
"reference": "510f4869856d8dee98b1dc0a57f75f816d60de9a"
1791+
"reference": "5c0086551d56a17080d91d669043dba25da37f57"
17921792
},
17931793
"require": {
17941794
"automattic/jetpack-connection": "^2.10.1",

0 commit comments

Comments
 (0)