WordPress filter hook · part of WordPress core

allowed_options

A WordPress core filter that 6 plugins also fire themselves, running on 991K+ sites between them.

How to use allowed_options

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'allowed_options', function( $allowed_options ) {
	// Change $allowed_options here.
	return $allowed_options;
}, 10, 1 );

Argument names come from Imagify Image Optimization: Optimize Images's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

6 plugins that fire allowed_options

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Imagify Image Optimization: Optimize Images icon Imagify Image Optimization: Optimize Images900,000+ installs apply_filters( 'allowed_options', $allowed_options ) inc/classes/class-imagify-settings.php:386
  2. Theme My Login icon Theme My Login50,000+ installs apply_filters( 'allowed_options', $whitelist_options ) admin/settings.php:718
  3. Easy MCP AI icon Easy MCP AI40,000+ installs apply_filters( 'allowed_options', $allowed ) includes/cli-router/handlers/class-option-handler.php:920
  4. CS-Login icon CS-Login500+ installs apply_filters( 'allowed_options', $groups ) includes/admin-settings.php:481
  5. Solr Search for WordPress icon Solr Search for WordPress100+ installs apply_filters( 'allowed_options', array() ) includes/class-solrpower-options.php:93
  6. Visualithic Phyllix icon Visualithic PhyllixFewer than 10 installs apply_filters( 'allowed_options', (array) $new_allowed_options ) includes/class-aimos-app-link.php:908

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.