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

Latest news

  • ProcessWire Weekly #533
    In the 533rd issue of ProcessWire Weekly we'll check out some newly released third party modules and highlight a new site of the week. Read on!
    Weekly.pw / 27 July 2024
  • Page List Custom Children module
    This simple module gives you the ability to customize the parent/child relationship as it appears in the admin page list, enabling child pages to appear under more than one parent.
    Blog / 28 June 2024
  • Subscribe to weekly ProcessWire news

“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