Skip to content

Commit 51f739f

Browse files
swissspidyclaude
andcommitted
Read the title from the database in the SQLite --where scenario
wp cache isn't available here (cache-command isn't a dependency), and wp post create already caches the post, so read post_title directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
1 parent 2cf82b0 commit 51f739f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎features/search-replace-where.feature‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,8 @@ Feature: Test search-replace --where option
709709
"""
710710
And the return code should be 1
711711

712-
When I run `wp post get {POST_ID} --field=title`
712+
# Read the title from the database: search-replace doesn't flush a persistent object cache.
713+
When I run `wp db query "SELECT post_title FROM wp_posts WHERE ID = {POST_ID}" --skip-column-names`
713714
Then STDOUT should be:
714715
"""
715716
Title foo
@@ -721,9 +722,7 @@ Feature: Test search-replace --where option
721722
Success: Made 1 replacement.
722723
"""
723724

724-
# The title was read above, so a persistent object cache still holds the old one.
725-
When I run `wp cache flush`
726-
And I run `wp post get {POST_ID} --field=title`
725+
When I run `wp db query "SELECT post_title FROM wp_posts WHERE ID = {POST_ID}" --skip-column-names`
727726
Then STDOUT should be:
728727
"""
729728
Title bar

0 commit comments

Comments
 (0)