PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/routes/post-edit/route.js +20 -0 23.5.2 → trunk View file →
@@ -101,8 +101,11 @@
101 101 );
102 102 if (post?.title?.rendered) {
103 103 return (0, import_html_entities.decodeEntities)(post.title.rendered);
104 104 }
105 + if (post?.title?.raw) {
106 + return post.title.raw;
107 + }
105 108 const postType = await (0, import_data.resolveSelect)(import_core_data.store).getPostType(
106 109 params.type
107 110 );
108 111 return postType?.labels?.edit_item || (0, import_i18n.__)("Edit");
@@ -113,8 +116,25 @@
113 116 return {
114 117 postType: params.type,
115 118 postId
116 119 };
120 + },
121 + async loader(context) {
122 + const { params, search } = context;
123 + if (search.selectedBlock) {
124 + (0, import_data.dispatch)(import_core_data.store).editEntityRecord(
125 + "postType",
126 + params.type,
127 + getPostId(params),
128 + {
129 + selection: {
130 + selectionStart: { clientId: search.selectedBlock },
131 + selectionEnd: { clientId: search.selectedBlock }
132 + }
133 + },
134 + { undoIgnore: true }
135 + );
136 + }
117 137 }
118 138 };
119 139 export {
120 140 route