| @@ -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 |