$sanitizer->selectorValueAdvanced() method

Sanitize selector value for advanced text search operator (#=)

The advanced text search operator #= supports some characters that are typically excluded from selector values, so this method enables you to prepare a selector value for use with it. This method should not be used for sanitizing any other kinds of selector values.

Characters that have meaning to the advanced text search operator include +-*()" and thus their appearance in the $value argument is assumed to be a command rather than text to search for. Though note that non-matching double quotes or parenthesis are removed.

Note: If double quotes are used in your selector value, this method will convert them to matching parenthesis, i.e. +"phrase" gets converted to +(phrase).

Available since version 3.0.182.


// basic usage
$bool = $sanitizer->selectorValueAdvanced($value);

// usage with all arguments
$bool = $sanitizer->selectorValueAdvanced($value, array $options = []);


valuestring, array
options (optional)array

See options for Sanitizer::selectorValue() method

Return value

bool mixed string

See Also

$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.185

Twitter updates

  • ProcessWire 3.0.192 (dev branch) contains 11 issue fixes and 5 pull requests, over 20 commits— More
    7 January 2022
  • ProcessWire 3.0.191 core updates: updates to the installer and the profile exporter module— More
    24 December 2021
  • This week ProcessWire went on a diet, trimming the core size from 15.5 MB down to 7.5 MB by moving optional site profiles into their own GitHub repos— More
    17 December 2021

Latest news

  • ProcessWire Weekly #401
    In the 401st issue of ProcessWire Weekly we'll cover the latest core updates, check out a brand new module called Lister Native Date Format, and more. Read on!
    Weekly.pw / 15 January 2022
  • ProcessWire 3.0.190 core updates
    ProcessWire 3.0.190 has 15 commits relative to 3.0.189 and contains a mixture of issue resolutions and feature additions. This post covers them all, in addition to updates for the PageAutosave and ProFields Table modules.
    Blog / 3 December 2021
  • Subscribe to weekly ProcessWire news

I just love the easy and intuitive ProcessWire API. ProcessWire rocks!” —Jens Martsch, Web developer