Skip to content

Revert 8 feature/40365 rest sites endpoint super admin - #13869

Closed
lloc wants to merge 32 commits into
WordPress:trunkfrom
lloc:revert-8-feature/40365-rest-sites-endpoint-super-admin
Closed

lloc wants to merge 32 commits into
WordPress:trunkfrom
lloc:revert-8-feature/40365-rest-sites-endpoint-super-admin

Conversation

@lloc

@lloc lloc commented Sep 30, 2026

Copy link
Copy Markdown

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.

lloc and others added 30 commits August 14, 2026 17:05
Introduces WP_REST_Sites_Controller plus tests.
See #40365.
…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
@github-actions

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props realloc, spacedmonkey.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Trac Ticket Missing

This 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.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@lloc lloc closed this Oct 1, 2026
@lloc
lloc deleted the revert-8-feature/40365-rest-sites-endpoint-super-admin branch October 13, 2026 13:22
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.

2 participants