Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-278: In the title block, manually setting a custom title back to the original title does not work #279

Merged
merged 4 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading