Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP CLI instant results template commands #3216

Merged
merged 9 commits into from
Jan 20, 2023

Conversation

oscarssanchez
Copy link
Contributor

Description of the Change

This PR implements #3150

How to test the Change

Test the three new commands:

wp elasticpress get-search-template <--- Should retrieve the search template in JSON
wp elasticpress put-search-template <--- Should send the search template
wp elasticpress delete-search-template <--- Should delete search template

Changelog Entry

Added - WP CLI commands get-search-template put-search-template delete-search-template
Changed - Existing functionality
Deprecated - Soon-to-be removed feature
Removed - Feature
Fixed - Bug fix
Security - Vulnerability

Credits

Props @oscarssanchez

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link
Member

@felipeelia felipeelia left a comment

Choose a reason for hiding this comment

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

@oscarssanchez In addition to the points I've commented on, can we please standardize the commands' descriptions (some have Instant Results in lowercase, some don't mention it, etc.)? Thanks!

includes/classes/Command.php Outdated Show resolved Hide resolved
$template = json_decode( $instant_results->epio_get_search_template() );

$this->pretty_json_encode( $template, $assoc_args['pretty'] );
WP_CLI::success( esc_html__( 'Done', 'elasticpress' ) );
Copy link
Member

Choose a reason for hiding this comment

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

These output commands shouldn't have a "Done" in the end, so people can simply save its output in a JSON file without breaking it. Can we remove it please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense to me. Addressed here 89710cf @felipeelia

includes/classes/Command.php Outdated Show resolved Hide resolved
includes/classes/Command.php Outdated Show resolved Hide resolved
@felipeelia felipeelia merged commit a72fbf3 into develop Jan 20, 2023
@felipeelia felipeelia deleted the feature/cli-instant-results-template-commands branch January 20, 2023 13:23
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.

Add WP CLI commands for saving and deleting the Instant Results template.
2 participants