Skip to content

Update Services: use allowed_options in the Multisite snippet - #536

Open
ekamran wants to merge 1 commit into
WordPress:mainfrom
ekamran:shifteq/update-services-allowed-options
Open

ekamran wants to merge 1 commit into
WordPress:mainfrom
ekamran:shifteq/update-services-allowed-options

Conversation

@ekamran

@ekamran ekamran commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #535.

The Multisite snippet on Update Services adds ping_sites to the allowed options with the whitelist_options filter, which Core deprecated in WordPress 5.5. The page also offers the snippet as a custom plugin or must-use plugin, but the code block had no opening <?php tag or plugin header, so it did not work as a plugin file as written.

This:

  • switches the filter to allowed_options and changes the "Whitelist" comment to "Allow";
  • adds <?php and a Plugin Name header, so the block works as a must-use plugin or as a regular plugin;
  • adds a note that the snippet uses the allowed_options filter added in WordPress 5.5, and that older versions should use whitelist_options instead.

Testing

In Docker, on a Multisite network (subdirectory install) with WP_DEBUG and WP_DEBUG_LOG on, the network admin saved Settings > Writing with a new Update Services URL. The tested file is the page's code block, byte for byte.

WordPress 7.1.3 (PHP 8.3):

  • No snippet: the Update Services field is not shown, and saving leaves ping_sites unchanged.
  • Old snippet (whitelist_options), must-use plugin: the URL is saved, and debug.log gets "Hook whitelist_options is deprecated since version 5.5.0! Use allowed_options instead."
  • New snippet, must-use plugin: the URL is saved, with no deprecation notice.
  • New snippet, regular plugin: listed as "Update Services for Multisite", network activated, the URL is saved, with no deprecation notice.

WordPress 5.4.2 (PHP 7.4):

  • Old snippet: the URL is saved, with no notice (the filter was not deprecated yet).
  • New snippet: the field is shown, but the URL is not saved, which is the case the new version note covers.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code and Codex
Used for: Finding the issue by checking the handbook's hook names against Core, the change, Docker testing, and the wording of this description. I reviewed the change and the results, and I take responsibility for the contribution.

The whitelist_options filter was deprecated in WordPress 5.5 in favor
of allowed_options, so the snippet logged a deprecation notice when
WP_DEBUG was on. Also add the opening PHP tag and a plugin header so the
block works as a plugin file, and note the filter's name before 5.5.
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.

Update Services: the Multisite snippet uses the deprecated whitelist_options filter

2 participants