WordPress filter hook

validate_options

Fired by 22 WordPress plugins, running on 120K+ sites between them.

How to use validate_options

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

functions.php
add_filter( 'validate_options', function( $valid_fields, $fields ) {
	// Change $valid_fields here.
	return $valid_fields;
}, 10, 2 );

Argument names come from Ad Invalid Click Protector (AICP)'s source. Other plugins may pass different values: check the call in the plugin you're targeting below.

22 plugins that fire validate_options

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

  1. 3CX Free Live Chat, Calls & Messaging icon 3CX Free Live Chat, Calls & Messaging100,000+ installs apply_filters( 'validate_options', $output, $input ) admin/class-wplc-plugin-settings.php:384
  2. Ad Invalid Click Protector (AICP) icon Ad Invalid Click Protector (AICP)10,000+ installs apply_filters( 'validate_options', $valid_fields, $fields ) inc/admin_setup.php:449
  3. WP Server Health Stats icon WP Server Health Stats9,000+ installs apply_filters( 'validate_options', $valid_fields, $fields ) wp-server-stats.php:1389
  4. Change Sender Email icon Change Sender Email500+ installs apply_filters( 'validate_options', $valid_fields, $fields ) admin/class-wp-default-sender-email-by-it-pixelz-admin.php:247
  5. VenoMaps icon VenoMaps400+ installs apply_filters( 'validate_options', $valid_fields, $values ) include/class-venomaps-options.php:235
  6. WP-Bigfoot icon WP-Bigfoot100+ installs apply_filters( 'validate_options', $valid_fields, $fields ) admin/class-wp-bigfoot-admin.php:151
  7. AZScore: Live Score and football fixures and results icon AZScore: Live Score and football fixures and results100+ installs apply_filters( 'validate_options', $valid_fields, $fields ) src/Azscr_ThemeOptions.php:647
  8. Woo Product Carousel and Zoom icon Woo Product Carousel and Zoom100+ installs apply_filters( 'validate_options', $valid_fields, $fields ) admin/includes/settings.php:378
  9. SA Coronavirus Banner icon SA Coronavirus Banner40+ installs apply_filters( 'validate_options', $fields ) includes/admin/sa-covid-19-options.php:236
  10. Don Security icon Don Security20+ installs apply_filters( 'validate_options', $valid_fields, $fields ) admin/partials/don-security-admin-display.php:210
  11. Language Translator icon Language Translator10+ installs apply_filters( 'validate_options', $output, $input ) includes/class-thinker-language-translator.php:314
  12. Social Media Aggregator icon Social Media Aggregator10+ installs apply_filters( 'validate_options', $output, $input ) im-social-aggregator.php:523
  13. Color Picker icon Color Picker10+ installs apply_filters( 'validate_options', $valid_fields, $fields ) color.php:114
  14. Don Social Widget icon Don Social Widget10+ installs apply_filters( 'validate_options', $valid_fields, $fields ) dsw_settings.php:230
  15. SiteGlue icon SiteGlue10+ installs apply_filters( 'validate_options', $valid_fields, $fields ) siteglue-plugin.php:253
  16. Custom Styled WP Login Page icon Custom Styled WP Login Page10+ installs apply_filters( 'validate_options', $valid_fields, $fields ) classes/settings.class.php:200
  17. Gartentechnik.com icon Gartentechnik.com10+ installs apply_filters( 'validate_options', $validierte_felder, $felder ) _gtcom_adminbereich_optionen.php:45
  18. Saber Feedback Button icon Saber Feedback ButtonFewer than 10 installs apply_filters( 'validate_options', $valid_fields, $fields ) saber-feedback-button.php:288
  19. Simple Posting icon Simple PostingFewer than 10 installs apply_filters( 'validate_options', $valid_fields, $fields ) simple-posting.php:589
  20. BW Coronavirus Banner icon BW Coronavirus BannerFewer than 10 installs apply_filters( 'validate_options', $fields ) includes/admin/bw-covid-19-options.php:236
  21. Theme Structure Visualiser icon Theme Structure VisualiserFewer than 10 installs apply_filters( 'validate_options', $valid_fields, $fields ) admin/class-admin-settings.php:195
  22. Thematic Maps icon Thematic MapsFewer than 10 installs apply_filters( 'validate_options', $new_options, $input ) admin/class-thematic-maps-admin.php:416

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.