Skip to content

Conversation

imrraaj
Copy link

@imrraaj imrraaj commented May 27, 2024

This PR implements the exclude_revisions flag for wp db search command. This flag allows users to exclude revisions from the search results.

PR fixes following issues:

Usage

wp db search <search> [--tables=<tables>] [--exclude_revisions]

@imrraaj imrraaj marked this pull request as ready for review June 18, 2024 11:22
@imrraaj imrraaj requested a review from a team as a code owner June 18, 2024 11:22
* @see https://github.com/WordPress/wordpress-develop/blob/5.4.0/src/wp-includes/wp-db.php#L559-L572
*
* @var string[] Array of SQL mode names that are incompatible with WordPress.
*/
protected $sql_incompatible_modes = [
protected $sql_incompatible_modes = array(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ernilambar
Copy link
Member

@imrraaj Also can you please add Behat test for this new feature? Ref - https://make.wordpress.org/cli/handbook/contributions/pull-requests/#functional-tests

@imrraaj
Copy link
Author

imrraaj commented Jun 19, 2024

@ernilambar I'll do the necessary changes and I'll add the tests for the same

@imrraaj imrraaj marked this pull request as draft June 20, 2024 08:29
@imrraaj imrraaj marked this pull request as ready for review June 25, 2024 12:26
@fatihturan
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants