[wp-trac] [WordPress Trac] #55515: About the problem that the php file of the theme editor and plugin editor cannot be edited in multi-site
WordPress Trac
noreply at wordpress.org
Tue Mar 10 11:18:50 UTC 2026
#55515: About the problem that the php file of the theme editor and plugin editor
cannot be edited in multi-site
----------------------------------------+------------------------
Reporter: ishihara takashi | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Networks and Sites | Version: 5.9.2
Severity: normal | Resolution: wontfix
Keywords: dev-feedback has-test-info | Focuses: multisite
----------------------------------------+------------------------
Comment (by ampluswp):
Hello
I ran into the same issue and spent quite some time debugging it. In my
case this happened in a WordPress Multisite installation when trying to
edit functions.php via the built-in Theme Editor in the network admin.
The strange thing was that:
saving style.css worked
saving functions.php always failed with the message that WordPress could
not verify the site communication and therefore reverted the change
no PHP error appeared in debug.log
the AJAX request itself returned HTTP 200
After adding extensive logging I found that the actual save request works
correctly (admin-ajax.php, action edit-theme-plugin-file). The problem
occurs in the second request that WordPress performs to validate the PHP
file.
WordPress sends a loopback request like this:
/wp-admin/theme-
editor.php?theme=...&file=functions.php&wp_scrape_key=...&wp_scrape_nonce=...
In a Multisite environment this request ends up loading the network theme
editor page, returning the full admin HTML instead of the expected scrape
response. Because of that the validation step fails and WordPress rolls
back the change even though the file itself is valid.
Key observations from the logs:
save request succeeds
response code 200
no PHP errors
loopback request returns the full network theme editor HTML
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55515#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list