Skip to content

Commit 0e9ba27

Browse files
authored
Improve WordPress 6.9 compatibility (#14405)
1 parent 3b9f615 commit 0e9ba27

File tree

4 files changed

+26
-31
lines changed

4 files changed

+26
-31
lines changed

packages/e2e-test-utils/src/publishPost.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function publishPost() {
9292
.getPostType(wp.data.select('core/editor').getCurrentPostType()).labels
9393
.view_item
9494
);
95-
const linkTextRegex = new RegExp(`^(${linkText}|View Post)$`);
95+
const linkTextRegex = new RegExp(`^(${linkText}|View Post)`);
9696

9797
await expect(page).toMatchElement('a', { text: linkTextRegex });
9898

packages/e2e-tests/src/specs/editor/passwordProtected.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('Password protected stories', () => {
7373
await previewPage.focus('input[name="post_password"]');
7474

7575
await expect(previewPage).toMatchTextContent(
76-
'This content is password protected'
76+
/This content is password[- ]protected/
7777
);
7878

7979
await expect(previewPage).toFill('input[name="post_password"]', 'password');

packages/wp-dashboard/src/api/settings.js

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
/**
17-
* External dependencies
18-
*/
19-
import { addQueryArgs } from '@googleforcreators/url';
2016

2117
/**
2218
* WordPress dependencies
@@ -66,10 +62,10 @@ export function fetchSettings(apiPath) {
6662
* Update settings.
6763
*
6864
* @param {string} apiPath API path.
69-
* @param {Object} queryParams Query parameters to apply to URL.
65+
* @param {Object} settingsParams Settings to update.
7066
* @return {Promise} Request promise.
7167
*/
72-
export function updateSettings(apiPath, queryParams) {
68+
export function updateSettings(apiPath, settingsParams) {
7369
const {
7470
googleAnalyticsId,
7571
usingLegacyAnalytics,
@@ -88,82 +84,81 @@ export function updateSettings(apiPath, queryParams) {
8884
autoAdvance,
8985
defaultPageDuration,
9086
googleAnalyticsHandler,
91-
} = queryParams;
87+
} = settingsParams;
9288

93-
const query = {};
89+
const settings = {};
9490

9591
if (googleAnalyticsId !== undefined) {
96-
query.web_stories_ga_tracking_id = googleAnalyticsId;
92+
settings.web_stories_ga_tracking_id = googleAnalyticsId;
9793
}
9894

9995
if (usingLegacyAnalytics !== undefined) {
100-
query.web_stories_using_legacy_analytics = usingLegacyAnalytics;
96+
settings.web_stories_using_legacy_analytics = usingLegacyAnalytics;
10197
}
10298

10399
if (adSensePublisherId !== undefined) {
104-
query.web_stories_adsense_publisher_id = adSensePublisherId;
100+
settings.web_stories_adsense_publisher_id = adSensePublisherId;
105101
}
106102

107103
if (adSenseSlotId !== undefined) {
108-
query.web_stories_adsense_slot_id = adSenseSlotId;
104+
settings.web_stories_adsense_slot_id = adSenseSlotId;
109105
}
110106

111107
if (adManagerSlotId !== undefined) {
112-
query.web_stories_ad_manager_slot_id = adManagerSlotId;
108+
settings.web_stories_ad_manager_slot_id = adManagerSlotId;
113109
}
114110

115111
if (mgidWidgetId !== undefined) {
116-
query.web_stories_mgid_widget_id = mgidWidgetId;
112+
settings.web_stories_mgid_widget_id = mgidWidgetId;
117113
}
118114

119115
if (adNetwork !== undefined) {
120-
query.web_stories_ad_network = adNetwork;
116+
settings.web_stories_ad_network = adNetwork;
121117
}
122118

123119
if (videoCache !== undefined) {
124-
query.web_stories_video_cache = Boolean(videoCache);
120+
settings.web_stories_video_cache = Boolean(videoCache);
125121
}
126122

127123
if (dataRemoval !== undefined) {
128-
query.web_stories_data_removal = Boolean(dataRemoval);
124+
settings.web_stories_data_removal = Boolean(dataRemoval);
129125
}
130126

131127
if (archive !== undefined) {
132-
query.web_stories_archive = archive;
128+
settings.web_stories_archive = archive;
133129
}
134130

135131
if (archivePageId !== undefined) {
136-
query.web_stories_archive_page_id = archivePageId;
132+
settings.web_stories_archive_page_id = archivePageId;
137133
}
138134

139135
if (shoppingProvider !== undefined) {
140-
query.web_stories_shopping_provider = shoppingProvider;
136+
settings.web_stories_shopping_provider = shoppingProvider;
141137
}
142138

143139
if (shopifyHost !== undefined) {
144-
query.web_stories_shopify_host = shopifyHost;
140+
settings.web_stories_shopify_host = shopifyHost;
145141
}
146142

147143
if (shopifyAccessToken !== undefined) {
148-
query.web_stories_shopify_access_token = shopifyAccessToken;
144+
settings.web_stories_shopify_access_token = shopifyAccessToken;
149145
}
150146

151147
if (autoAdvance !== undefined) {
152-
query.web_stories_auto_advance = Boolean(autoAdvance);
148+
settings.web_stories_auto_advance = Boolean(autoAdvance);
153149
}
154150

155151
if (defaultPageDuration !== undefined) {
156-
query.web_stories_default_page_duration = defaultPageDuration;
152+
settings.web_stories_default_page_duration = defaultPageDuration;
157153
}
158154

159155
if (googleAnalyticsHandler !== undefined) {
160-
query.web_stories_ga_tracking_handler = googleAnalyticsHandler;
156+
settings.web_stories_ga_tracking_handler = googleAnalyticsHandler;
161157
}
162158

163-
const path = addQueryArgs(apiPath, query);
164-
165159
return apiFetch({
166-
path,
160+
path: apiPath,
167161
method: 'POST',
162+
data: settings,
168163
}).then(transformSettingResponse);
169164
}

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== Web Stories ===
22

33
Contributors: google
4-
Tested up to: 6.8
4+
Tested up to: 6.9
55
Requires at least: 6.6
66
Stable tag: V.V.V
77
License: Apache-2.0

0 commit comments

Comments
 (0)