Skip to content

Commit 2da6b59

Browse files
swissspidyclaude
andcommitted
Document --exclude_revisions scope and test another site's posts table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
1 parent 4a9e2e5 commit 2da6b59

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎features/db-search.feature‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,25 @@ Feature: Search through the database
10131013
1
10141014
"""
10151015

1016+
Scenario: Search with exclude revisions option on another site's posts table
1017+
Given a WP multisite install
1018+
And I run `wp site create --slug=second --porcelain`
1019+
And I run `wp post create --url=example.com/second --post_content="This is the original post content." --post_title="Original Post" --post_status=publish --porcelain`
1020+
And save STDOUT as {POST_ID}
1021+
And I run `wp post update {POST_ID} --url=example.com/second --post_content="This is the updated post content."`
1022+
1023+
When I run `wp db search "updated post content" wp_2_posts --network --format=count`
1024+
Then STDOUT should be:
1025+
"""
1026+
2
1027+
"""
1028+
1029+
When I run `wp db search "updated post content" wp_2_posts --network --exclude_revisions --format=count`
1030+
Then STDOUT should be:
1031+
"""
1032+
1
1033+
"""
1034+
10161035
@skip-windows
10171036
Scenario: Search with custom colors
10181037
Given a WP install

‎src/DB_Command.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,8 @@ private static function format_size_si( $bytes ) {
18741874
* ---
18751875
*
18761876
* [--exclude_revisions]
1877-
* : Exclude revisions from the search.
1877+
* : Exclude revisions from the search, by skipping rows of the `revision` post type in
1878+
* posts tables (of every site in a network). Post meta of revisions is still searched.
18781879
*
18791880
* The percent color codes available are:
18801881
*

0 commit comments

Comments
 (0)