Selectors::getSelectorByOperator() method

Given an operator, return Selector instance (or other requested Selector property)

When getting a Selector instance, be sure to populate its field and value properties after retrieving it.

Available since version 3.0.160.


// basic usage
$selector = Selectors::getSelectorByOperator(string $operator);

// usage with all arguments
$selector = Selectors::getSelectorByOperator(string $operator, string $property = 'instance');



Operator to get Selector instance for

property (optional)string

One of 'instance,', 'label', 'compareType', 'class', 'className' (default='instance')

Return value

Selector int string false

Returns false if operator or property not recognized

Selectors methods and properties

API reference based on ProcessWire core version 3.0.184

Twitter updates

  • ProcessWire 3.0.185 (dev) core updates, plus new Session Allow module— More
    17 September 2021
  • Three new ProcessWire Textformatter modules: Find/Replace, Markdown in Markup, and Emoji— More
    3 September 2021
  • This week we have a new master version released after a year in the making. With nearly 40 pull requests, hundreds of new additions and more than 100 issue reports resolved, this new version has a ton of great new stuff— More
    27 August 2021

Latest news

  • ProcessWire Weekly #384
    In the 384th issue of ProcessWire Weekly we'll cover the latest core updates, introduce a new module called Session Allow, and highlight a new site of the week. Read on! / 18 September 2021
  • ProcessWire 3.0.184 new master/main version
    This week we have a new master/main version released after a full year in the making. As you might imagine, this new version has a ton of great new stuff and we’ll try to cover much of it here.
    Blog / 27 August 2021
  • Subscribe to weekly ProcessWire news

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani