Skip to content

BUG: Evaluate other assoc_args as booleans #3199

Closed
@oscarssanchez

Description

Describe the bug

With #3185 we can validate values strictly. There are other areas of improvement to implement this for example:

public function get_last_cli_sync( $args, $assoc_args ) {

	$last_sync = Utils\get_option( 'ep_last_cli_index', array() );

	if ( isset( $assoc_args['clear'] ) ) {
		Utils\delete_option( 'ep_last_cli_index' );
	}

	$this->pretty_json_encode( $last_sync, $this->filter_boolean( $assoc_args['pretty'] ) );
}

As of now, the original problem we were solving for the pretty flag seems to be true for other scenarios like this.

Steps to Reproduce

1.- Pass any value to the --clear flag for get-last-cli-sync
2.- It should delete the ep_last_cli_index option

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions