Implement exclude revision flag to remove revision results from the search#255
Implement exclude revision flag to remove revision results from the search#255imrraaj wants to merge 8 commits intowp-cli:mainfrom
Conversation
src/DB_Command.php
Outdated
| * @var string[] Array of SQL mode names that are incompatible with WordPress. | ||
| */ | ||
| protected $sql_incompatible_modes = [ | ||
| protected $sql_incompatible_modes = array( |
There was a problem hiding this comment.
Can you please revert changes in this and similar unrelated lines? For fixing code sniffer issues, please use composer run phpcbf. It seems you are using separate sniffer rules here.
|
@imrraaj Also can you please add Behat test for this new feature? Ref - https://make.wordpress.org/cli/handbook/contributions/pull-requests/#functional-tests |
|
@ernilambar I'll do the necessary changes and I'll add the tests for the same |
|
I hope you merge this into the new version of the WP CLI soon. I am still looking for a workaround to exclude revisions while exporting the database, but I can't find it yet. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds an --exclude_revisions flag to the wp db search command to filter out revision posts from search results in the wp_posts table.
Key changes:
- Added
--exclude_revisionsparameter documentation to thesearchcommand - Implemented logic to exclude posts with
post_type = 'revision'when the flag is enabled - Added test coverage for the new functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/DB_Command.php | Added --exclude_revisions flag implementation with WHERE clause filtering for wp_posts table |
| features/db-search.feature | Added test scenario verifying revision exclusion behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This PR implements the exclude_revisions flag for
wp db searchcommand. This flag allows users to exclude revisions from the search results.PR fixes following issues:
wp db search#156Usage