Repository navigation
Conversation
Introduces WP_REST_Sites_Controller plus tests. See #40365.
…and add missing group annotations
…oint-tests Tests: Add unit tests for WP_REST_Site_Meta_Fields functionality
…oint-more-tests Tests: Rename rest-sites-controller.php to wpRestSitesController.php …
Add format validation for the `domain` and `path` parameters in WP_REST_Sites_Controller so malformed values are rejected with a clean 400 rest_invalid_param instead of failing later inside wp_insert_site()/ wp_update_site() (which surfaces as a 500). domain must be a valid hostname or bare IPv4/IPv6 address, optionally followed by a port (bracketed IPv6 is intentionally not supported, so IPv6 addresses can't carry a port). path must start and end with a forward slash and be made up of characters valid in a URL path segment. Ticket #40365.
…t-check-exists' into feature/40365-rest-sites-endpoint-check-exists # Conflicts: # src/wp-includes/rest-api/endpoints/class-wp-rest-sites-controller.php
…oint-force-delete Enhance site deletion process to support force deletion and user removal
…oint-check-exists Check if domain exists before creating / updating.
…ler.php Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
…ler.php Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
…ler.php Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
…e(). The method checks both the `domain` and `path` of a prepared site, not just the domain, so `check_domain_is_available()` was a misleading name. Renamed to check_url_is_available() (domain + path together form the site's URL) and updated its one call site accordingly. Docblock already described the domain+path behavior correctly and needed no changes; no tests reference the method by name, and the existing domain/path-taken conflict tests (test_create_item_domain_validation, test_update_item_*) continue to pass unchanged since this is a pure rename with no behavior change. See #40365. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a get_reflective_method() helper (matching the pattern already used in wpRestUrlDetailsController.php) to directly unit test the renamed protected method, rather than only exercising it indirectly through create_item()/update_item(). Covers, using @dataProvider where the setup is shared: - create: a brand new domain/path is available, an existing one is rejected, and omitting `path` entirely falls back to '/' and still conflicts (test_check_url_is_available_on_create, 3 data sets). - update: keeping the site's own domain/path via the current-site fallback is not a conflict, changing to another site's domain/path is (test_check_url_is_available_on_update, 2 data sets). - the same domain/path is available on a different network (standalone, needs its own network fixture). - an invalid site ID on update propagates get_site()'s WP_Error rather than reaching the domain/path check (standalone, distinct assertion). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…oint-super-admin Add per-network super-admin scoping to REST sites controller
…oint-v2 Define allow_batch support for site endpoints
REST API: Rename check_domain_is_available() to check_url_is_available()
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Trac Ticket MissingThis pull request is missing a link to a Trac ticket. For a contribution to be considered, there must be a corresponding ticket in Trac. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. More information about contributing to WordPress on GitHub can be found in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Trac ticket:
Use of AI Tools
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.