Skip to content

Commit

Permalink
Merge pull request #279 from alleyinteractive/fix/issue-278/title-blo…
Browse files Browse the repository at this point in the history
…ck-custom-reset-fails

Issue-278: In the title block, manually setting a custom title back to the original title does not work
  • Loading branch information
mogmarsh authored Jan 14, 2025
2 parents cb53134 + 6d3ac0f commit a452805
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## 2.4.9 - 2025-01-13

- Bug Fix: Allow manually resetting custom post title back to original title.

## 2.4.8 - 2024-12-17

- Bug Fix: Roll back to React 18 again.
Expand Down
9 changes: 5 additions & 4 deletions blocks/post-title/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ export default function Edit({
* Handle cases for when it's not necessary to update the collection of
* custom titles
*/
if (
title === rawTitle
|| title === currentCustomPostTitle?.title
) {
if (title === currentCustomPostTitle?.title) {
return;
}

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

// @ts-ignore
dispatch('core/block-editor').updateBlockAttributes(queryParentId, {
Expand Down
2 changes: 1 addition & 1 deletion wp-curate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Curate
* Plugin URI: https://github.com/alleyinteractive/wp-curate
* Description: Plugin to curate homepages and other landing pages
* Version: 2.4.8
* Version: 2.4.9
* Author: Alley Interactive
* Author URI: https://github.com/alleyinteractive/wp-curate
* Requires at least: 6.4
Expand Down

0 comments on commit a452805

Please sign in to comment.