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

Add command to get the post ID by URL #449

Merged
merged 7 commits into from Nov 19, 2023

Conversation

JulianBustamante
Copy link
Contributor

@JulianBustamante JulianBustamante commented Nov 16, 2023

See #429

  • Adds url-to-id command to get the post ID from its URL.
  • url_to_postid() doesn't check if the post exists when the URL contains the post id as a parameter.

Then STDOUT should contain:
"""
{POST_ID}
"""
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a test for the error case too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sure!

@JulianBustamante JulianBustamante marked this pull request as ready for review November 17, 2023 09:52
@JulianBustamante JulianBustamante requested a review from a team as a code owner November 17, 2023 09:52
Copy link
Member

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

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

Great work on this, @JulianBustamante !

@swissspidy swissspidy merged commit bc7f0e4 into wp-cli:main Nov 19, 2023
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants