WireArray::filter() method

Filter this WireArray to only include items that match the given selector (destructive)

Example

// Filter $items to contain only those with "featured" property having value 1
$items->filter("featured=1"); 

Usage

$wireArray->filter($selector);

Arguments

NameType(s)Description
selectorstring, array, Selectors

Selector string or array to use as the filter.

Return value

$this

reference to current instance.


WireArray methods and properties

API reference based on ProcessWire core version 3.0.236

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer