ACF Helper

Query
in package

Query class for database interaction in WordPress

Tags
since
1.0.0

Table of Contents

filterUserQuery()  : void
Filter WordPress user queries
getRepeaterRowsBySubfieldValue()  : array<string|int, mixed>
Get repeater rows by a subfield value.
getUsersWithFlexibleContentValue()  : array<string|int, mixed>
Get users with a given flexible content custom field value and layout.

Methods

filterUserQuery()

Filter WordPress user queries

public static filterUserQuery(string $metaKeyDollar, string $metaKeyRegexp) : void

Used to replace placeholders in meta queries ($) for dynamic ACF field names with LIKE instead of = expressions.

Parameters
$metaKeyDollar : string

The meta key with a dollar sign as placholder, as used in WordPress meta queries.

$metaKeyRegexp : string

Meta key in regular expression format.

Tags
since
1.0.0
Return values
void

getRepeaterRowsBySubfieldValue()

Get repeater rows by a subfield value.

public static getRepeaterRowsBySubfieldValue(string $field, string $subfield, string $subfieldValue) : array<string|int, mixed>
Parameters
$field : string

The repeater field name.

$subfield : string

The repeater sub field name.

$subfieldValue : string

The repeater sub field value.

Tags
since
1.1.0
Return values
array<string|int, mixed>

getUsersWithFlexibleContentValue()

Get users with a given flexible content custom field value and layout.

public static getUsersWithFlexibleContentValue(string $field, string $layout, string $subfield, string $subfieldValue) : array<string|int, mixed>
Parameters
$field : string

The flexible content field name.

$layout : string

The flexible layout name.

$subfield : string

The name of the layouts sub field.

$subfieldValue : string

The value of the layouts sub field.

Tags
author

Levi Cole

since
1.0.0
see
https://wordpress.stackexchange.com/a/402148/218274
Return values
array<string|int, mixed>

Search results