Skip to content

Commit a452805

Browse files
authored
Merge pull request #279 from alleyinteractive/fix/issue-278/title-block-custom-reset-fails
Issue-278: In the title block, manually setting a custom title back to the original title does not work
2 parents cb53134 + 6d3ac0f commit a452805

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to `WP Curate` will be documented in this file.
44

5+
## 2.4.9 - 2025-01-13
6+
7+
- Bug Fix: Allow manually resetting custom post title back to original title.
8+
59
## 2.4.8 - 2024-12-17
610

711
- Bug Fix: Roll back to React 18 again.

blocks/post-title/edit.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ export default function Edit({
9292
* Handle cases for when it's not necessary to update the collection of
9393
* custom titles
9494
*/
95-
if (
96-
title === rawTitle
97-
|| title === currentCustomPostTitle?.title
98-
) {
95+
if (title === currentCustomPostTitle?.title) {
9996
return;
10097
}
10198

@@ -113,6 +110,10 @@ export default function Edit({
113110
},
114111
];
115112
}
113+
// If the custom title matches the original title, we don't want to store it.
114+
if (title === rawTitle) {
115+
newCustomPostTitles = newCustomPostTitles.filter((item) => item?.postId !== postId);
116+
}
116117

117118
// @ts-ignore
118119
dispatch('core/block-editor').updateBlockAttributes(queryParentId, {

wp-curate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WP Curate
44
* Plugin URI: https://github.com/alleyinteractive/wp-curate
55
* Description: Plugin to curate homepages and other landing pages
6-
* Version: 2.4.8
6+
* Version: 2.4.9
77
* Author: Alley Interactive
88
* Author URI: https://github.com/alleyinteractive/wp-curate
99
* Requires at least: 6.4

0 commit comments

Comments
 (0)