Implement wp site get command to enable site operations by URL#571
Implement wp site get command to enable site operations by URL#571
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
… reliability Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| $site = null; | ||
|
|
||
| // Check if the argument is a URL (contains :// or starts with www.) | ||
| if ( false !== strpos( $site_arg, '://' ) || 0 === strpos( $site_arg, 'www.' ) ) { |
There was a problem hiding this comment.
@copilot can we use get_blog_id_from_url here? it's cached. signature: function get_blog_id_from_url( $domain, $path = '/' ): int (returns 0 if no blog found, otherwise the ID of the matching blog.)
There was a problem hiding this comment.
Done! Refactored to use get_blog_id_from_url() instead of the direct database query. This provides better performance through caching and uses the standard WordPress API. (e91a6e5)
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
wp site getcommand that accepts site ID or URLOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.